NiceWatch: print to pdf with filter

Dieses Forum ist für alle NiceLabel Fragen für die deutschen Benutzer.

Moderators: Georges, milos, RobertK, tb, rom, NiceLabel Support Team

Post Reply
vision2010
Valued Contributor
Posts: 23
Joined: Fri Jun 04, 2010 11:04 am

NiceWatch: print to pdf with filter

Post by vision2010 » Wed Sep 05, 2012 3:50 pm

I want to print to pdf.
The labelname is f.e. nl_job.lbl. The filter-variable is anr_filter.
I sent it to the pdf creator and got the file nl.job.pdf
I need for each filter its one Filename - the jobnumer.pdf
F.e. anr_filter = 4711 should be printed in 4711.pdf and so on.
How can I change the outputfilename before printing ?
Can you help me and send me an example.

Thank's for your help

User avatar
Saso
NiceLabel
NiceLabel
Posts: 2963
Joined: Mon Sep 04, 2006 8:09 am
Contact:

Re: NiceWatch: print to pdf with filter

Post by Saso » Thu Sep 06, 2012 2:54 pm

The attached sample »Print to PDF« will convert NiceLabel’s label file (.LBL) into a PDF file.
To achieve the task the utility PDFCreator must be installed on the system. Get it here: http://sourceforge.net/projects/pdfcreator/

In the first trigger NiceWatch gets the information from the trigger file and prints the label to PostScript (.PS) file. The name of the file is obtained from the trigger file (as contents of the file).

In the second trigger NiceWatch converts the .PS file into .PDF.
The application PDFCreator is run with the command-line parameters to make the conversion.

Brief instructions:
  1. Put all files into the folder c:\temp
  2. The trigger file data.txt is CSV file (currently with only one field).
  3. Trigger no.1 reads the data from the CSV file into variable var1.
  4. The actions will do the following:
    • Generate the filename for the PS/PDF file.
    • Execute printing.
    • Redirect printing to the specified filename. The folder “c:\temp” is used, but you can change the location.
  5. Trigger no.2 converts the PostScript file (.PS) into PDF
The solution can be further fine-tuned; e.g. deleting the intermediate .PS files, etc.
Attachments
sample-print-to-pdf.zip
(5.55 KiB) Downloaded 477 times
Saso Fleiser
Senior Technical Product Specialist

vision2010
Valued Contributor
Posts: 23
Joined: Fri Jun 04, 2010 11:04 am

Re: NiceWatch: print to pdf with filter

Post by vision2010 » Thu Sep 06, 2012 4:37 pm

Hello Saso,
thanks for your help. It works fine. Now i can tune te trigger and delete the ps-files.

have an nice day. :D

Post Reply