...
Refer to the Threadpool Configuration section under the Common Configurations page.
Testing
...
Functional Demonstration
XML and XSL
Configure XML2PDF component to use XML and XSL as input type as explained in Configuration and Testing section.
...
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
Figure 5: Output PDF File Created
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version="1.0">
<xsl:template match="/">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="my-page">
<fo:region-body margin="1cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="my-page">
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="FX">
<fo:block background-color="#00b2e6" font-weight="bold" space-after="10pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="speech[@speaker = 'Def']">
<fo:block background-color="#00b2e6" space-after="10pt">
<xsl:value-of select="@speaker"/>:
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="speech">
<fo:block space-after="10pt">
<xsl:value-of select="@speaker"/>:
<xsl:apply-templates/>
</fo:block>
</xsl:template>
</xsl:stylesheet> |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<scene>
<FX>XML 2 PDF Test</FX>
<speech speaker="Abc">
Test Test Test 123.
Test Test Test 123
Test Test Test 123
</speech>
<speech speaker="Def">
456 456 456
456 456 456
456 456 456
456 456 456
</speech>
</scene> |
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.
Figure 6: Sample Input
...
Sample Input
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="content" margin="0.5in">
<fo:region-body region-name="body" margin-top="0.5in"
column-count="2"/>
<fo:region-before region-name="header" extent="0.25in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="content">
<fo:static-content flow-name="header">
<fo:block border-bottom-width="1px" border-bottom-style="solid"
text-align="end">FIORANO</fo:block>
</fo:static-content>
<fo:flow flow-name="body">
<fo:block span="all" font-size="14pt" font-weight="bold"
text-align="center" padding-before="16pt">
I. HEADING 1
</fo:block>
<fo:block space-before="8pt">
This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text.
This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text.
</fo:block>
<fo:block span="all" font-size="14pt" font-weight="bold"
text-align="center" padding-before="16pt">
II. HEADING 2
</fo:block>
<fo:block space-before="8pt">
This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text.
</fo:block>
<fo:block space-before="8pt">
This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text.
</fo:block>
<fo:block span="all" font-size="14pt" font-weight="bold"
text-align="center" padding-before="16pt">
III. HEADING 3
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root> |
Output
Figure 6: Output generated in the Display window in XML format
Figure 7: Output PDF File