|
|
Properties
|
|
Path to the linked file in the repository |
|
|
Set component parameters, see Using Component Parameters |
|
|
Output format of the report
Using the PDF/A option, Apache FOP 1.0 requires specifying a font (using attribute
|
Creating reports with XSL-FO
The PDF Creator component allows to dynamically generate documents for print (reports) during process runtime. A report is a specific XSL mapping that transforms input XML data and outputs an XML document with XSL-FO syntax. The X4 BPMS will convert the generated XSL-FO document automatically into the specified output format and will hand it over to the next process step.
The X4 BPMS uses Apache FOP as XSL-FO processor to process reports.
The XSL-FO element <fo:external-graphic src="url('path/to/file.png')"> allows to embed graphic files (e.g., GIF, JPEG, PNG, SVG) into your report document. You can also specify the graphics path using xstore:/ URLs to reference files from the X4 repository, e.g.:
<fo:external-graphic src="url('xstore://Project/Folder/File.png')"
content-width="10mm" content-height="10mm"/>
The optional attributes content-width and content-height specify the graphic's width and height in the output document.
As an alternative, you can embed binary graphic files into the report as Base64-encoded string, see also Base64 Converter:
<fo:external-graphic src="url(data:;base64,Base64-kodierte Bilddaten)"/>
The source code of SVG images can also be embedded directly into the report, e.g.:
<fo:instream-foreign-object>
<svg:svg xmlns:svg="http://www.w3.org/2000/svg"
height="1mm" width="40mm">
<svg:line y1="0" y2="0" x1="0" x2="40mm"
style="stroke:#0000FF;stroke-width:0.5pt" />
</svg:svg>
</fo:instream-foreign-object>
Note that all SVG elements must use the namespace svg:.
Example
The following example is a very simple XSL-FO document:
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="simple" page-height="29.7cm"
page-width="21cm" margin-left="2.5cm" margin-right="2.5cm">
<fo:region-body margin-top="3cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simple">
<fo:flow flow-name="xsl-region-body">
<fo:block>Hello World</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
For more information on hyphenation, see https://xmlgraphics.apache.org/fop/2.5/hyphenation.html.