Save/export pdf to specific location ( in bulk )


Ronald Grentzius

Hello All,
For the goverment we have to save all our invoices for 7 years. We now print each document layout again. But we have the option to save the invoices digital in pdf for example. This saves the lives of a few tree's each year :D
The question is, can we save the layout marketing doc in pdf (without printing ) to a specific location. For example in bulk with a dateselection or maybe save it directly while every invoice is made?

Martin Ehrensberger

Hi Ronald,
To save a pdf for every printout, append the following script to the document generate-script:
If Not Engine.IsDoublePass Then
If GetData("LD.Par.PrintMode") = "N" And GetData("LD.Par.Preview") = "N" Then
End If
End If

Don't forget to specify the export-path in the print-definition e.g. c:exports[%CardCode]


Ronald Grentzius

Hi Martin,

Thanks for the help! The script works perfectly. I have one question about the script: we have multiple layouts in the print definition. With this script all of the layouts in the printdefinition are copied to the destination folder. Is it possible to only copy one layout to the destination folder? For example in the printdefinition of the outgoing invoices we print an Invoice, Packing List and Adress label. I only want to copy the Invoice and not the other layouts like adress label and packing list.


Best regards,

Ronald Grentzius

Philipp Knecht

Hi Ronald

In this case use a new PrintDef with only this layout.
And use the Code of the new Printdef in the ExecutePrintdef() - Method


Ronald Grentzius

Hi Philip,

Thanks for the quick reply. I have thought of that solution, only we print the layouts in a surtain order for our salesdepartment. When I make a new print def it will be printed before or after the other layouts. Is it possible to solve this with the generate script? So the order in which the layouts are printed will stay the same?


Best regards,

Ronald Grentzius



Please sign in to leave a comment.

Didn't find what you were looking for?

New post