With this workflow component you can merge an input file with a template (both InterFormNG2 and InterFormNG templates) to create the output stream in PDF format. This can later e.g. be sent to a (laser) printer, that supports PDF or as input for e.g. encryption or digitally signing before outputting the PDF file.
The PDF output is stored in the payload of the workflow and can later e.g. be saved to a file, or printed out by sending the payload to a printer.
For normal use you should also consider the workflow component, Create PDF file. This component creates a PDF file and saves it to the file system and keeps the original payload.
The input payload must be an XML or spooled file. A similar component for the intermediate payload is the Create PDF component.
Please notice the hint below for implementation.
To print out the PDF you can use the Set printer component and the To printer component.
Template
The template, that the input file is merged with to produce the merged output in the print data format, PDF. This can be a fixed value, but can also be set as an XPath expression.
As mentioned above this workflow component overwrites the contents of the payload of the workflow, which normally means, that the initial input file e.g. XML or spooled file is lost. If you however later in the same workflow need the original payload, then you get that in a couple of ways:
1.You can use this component as one of the last actions in the workflow, if you do not need the original payload again.
2.You can extract the information you need from the original payload into variables before the create PDF document is run and use the variables in expressions afterwards instead of the original payload.
3.Use the multi-cast workflow component
4.Save the original payload and retrieve it later
One way to avoid the loss of the original payload is use the multi-cast workflow component and here only change the payload in one of the branches and keep the original payload in the other. Here is one example:
The second string of the multi-cast gets the payload from before the multi-cast and the result of the create PDF document
Before you run the Create PDF document component you can save the original payload with the component, Payload to named property e.g. into backupData:
And after the create PDF document you can later retrieve the original payload with the component, Named property to payload:
In the Input type you need to 'tell' the workflow which file type that is retrieved.