This component creates PDF files using XML and XSL Style sheet (or XSL-FO) as input. It uses the Apache FOP library to create PDF files.

Configuration and Testing

Properties can be configured in the Configuration Property Sheet (CPS) of the component. The properties available are explained below.

Component Configuration


Figure 1: Component Configuration panel

Attributes

XML2PDF Configuration

Input and Output details of XML2PDF transformation have to be provided here. Click the ellipsis  button against this property to configure the same in the dialog box.


Figure 2: XML2PDF Configuration dialog box

Create PDF Using

The input to the component can be configured here. The component accepts data in 2 formats as follows:

  • XML and XSL
    The path of the XSL style sheet has to be specified in the Custom Property Sheet and XML data has to be sent as an input to the component through its input port
  • XSL-FO
    XSL-FO has to be sent as an input to the component through its input port.

Create PDF Using XML and XSL

XSL File Path

The path of the XSL Style Sheet has to be specified here. This property has a file filter and only the files with the .xsl extension will be shown in the file chooser.

Icon

This property is available only when the input type is selected as "XML and XSL".

Output Directory

The output directory in which PDF files have to be generated should be specified here.

Output File Name

The name for the output file that has to be created. By default, this name is used for the output file. If a different file name has to be used, then a JMS Property "filename" has to be set on the input message to the component.

User Configuration file

File containing custom configuration.

Named Configuration

A specific configuration can be configured as Named Configuration to use it across multiple instances.

Please refer to Save Named Configuration section in the Common Configurations page to know how to save a named configuration.

Error Handling Configuration

The remedial actions to be taken when a particular error occurs can be configured here.

Click the ellipsis  button against this property to configure Error Handling properties for different types of Errors.

Please refer Error Handling section in Common Configurations page for detailed information.

Expert Properties

Enable the Expert Properties view to configure these properties.

Icon

Expert properties are meant for advanced users.


Figure 3: XML2PDF CPS with the Expert Properties enabled and highlighted

Pre Processing XSL Configuration

Pre Processing XSL configuration can be used to transform request message before processing it. Click the ellipses button against the property to configure the properties.

Refer to the Pre/Post Processing XSL Configuration section under the Common Configurations page for details regarding Pre Processing XSL configuration and Post Processing XSL configuration (below).

Post Processing XSL Configuration 

Post Processing XSL configuration can be used to transform the response message before sending it to the output port.

Process Message Based on Property

The property helps components to skip certain messages from processing.

Refer to the Process Message Based On a Property section under the Common Configurations page 

Xslt Engine

Specify the transformer implementation that is used for performing the transformation.

Xalan (2.7.0) and Saxon (8.4) transformer implementations are bundled with Fiorano environment for performing transformations:

  • Xalan
    Xalan implementation (org.apache.xalan.processor.TransformerFactoryImpl) is used to perform transformation.

    Icon

    Xalan(2.7.0) does not support XSLT 2.0.

  • Saxon
    Saxon implementation (net.sf.saxon.TransformerFactoryImpl) is used to perform transformation.

    Icon

    Saxon implementation does not support custom functions.

Threadpool Configuration

 This property is used when there is a need to process messages in parallel within the component, still maintaining the sequence from the external perspective. 

Refer to the Threadpool Configuration section under the Common Configurations page.

Functional Demonstration

XML and XSL

Configure XML2PDF component to use XML and XSL as input type as explained in Configuration and Testing section.

Launch the flow and send the sample XML input through Feeder component.

If the PDF creation is successful, the component sends an XML message which contains OutputDirectory, OutputFile and Message elements on to its output.
If there is any error in generating the PDF file, an error message indicating the exceptions will be sent to the component's ON_EXCEPTION port.


Figure 4: Sample Event Process

Sample Input

XSL Style Sheet  Expand source
XML  Expand source


Output


Figure 5: Output generated in the Display window in XML format


Figure 6: Output PDF File

XSL-FO

Configure XML2PDF to use XSL-FO as input type. Launch the flow and send the sample XSL-FO input through Feeder component. Also use a different output file name by setting filename JMS property on the Input message.

If the PDF creation is successful, the component sends an XML output message which contains OutputDirectory, OutputFile and Message elements on to its output as shown below.
If there is any error in generating the PDF file, an error message indicating the exceptions will be sent to the component's ON_EXCEPTION port.

Sample Input

XSL-FO  Expand source

Output

Figure 6: Output generated in the Display window in XML format


Figure 7: Output PDF File

Adaptavist ThemeBuilder EngineAtlassian Confluence