Create PDF document

Create PDF document

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.

 

NG2WorkflowCreatePDFcomponent0001

 

 

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.

 

 

Hints for implementation

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

 

 

Use the multi-cast workflow component

 

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:

 

NGCreatePDFDocument0002

 

The second string of the multi-cast gets the payload from before the multi-cast and the result of the create PDF document

 

 

 

Save the payload and retrieve it later

 

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:

 

NGCreatePDFDocument0003

 

And after the create PDF document you can later retrieve the original payload with the component, Named property to payload:

 

NGCreatePDFDocument0004

 

In the Input type you need to 'tell' the workflow which file type that is retrieved.

    • Related Articles

    • Create PDF

      The Create PDF shortcut create document is used mostly internally. For normal creation of PDF file you should consider the Create PDF file component. The input payload for this component is intermediate. For use of this component: Please refer to the ...
    • Basic create document components

      Create document If you want to do a simple merge of an input file into an output, then you most likely can find the component here. The three components are: 1.Create PDF email 2.Create PDF file 3.Print
    • Create EML with PDF

      The create document, workflow component, Create EML with PDF is the same as the Create PDF email component with two major differences: The Create PDF email component sends out an email. The Create EML with PDF document creates an EML file in the ...
    • Create Excel document

      InterFormNG2 can generate an output excel file in the format .xlsx based on a special formatted XML file. Such an XML file can be generated by the related workflow component, Excel to XML. The advanced, Create Excel document component has these ...
    • Create PDF file

      The Create PDF file workflow component is found under Basic and create document. This component accepts an XML file as input. The component creates a PDF file and stores it directly in the file system. The output payload is the same as the input ...