Page 1 of 1

NiceWatch: print to pdf with filter

Posted: Wed Sep 05, 2012 3:50 pm
by vision2010
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

Re: NiceWatch: print to pdf with filter

Posted: Thu Sep 06, 2012 2:54 pm
by Saso
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.

Re: NiceWatch: print to pdf with filter

Posted: Thu Sep 06, 2012 4:37 pm
by vision2010
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