Skip to main content
Skip table of contents

PDF Creator

PDF Creator: Transforms an XML document into an XSL-FO document using an XSLT stylesheet. This is converted into a page-oriented output medium in the same process step via the XSL-FO processor Apache FOP 1.0. Possible output formats for reports are PDF, PDF/A, and PostScript.

Apache FOP-specific adjustments, such as the incorporation of fonts into a PDF file, can be made directly in the configuration file X4DB/0/fopuserconfig.xml.

Properties

Document

Path to the linked file in the repository

Component Parameters

Component Parameter. For more information, see Using Component Parameters .

Report type

Output format of the report

Possible values:

  • PDF: Portable Document Format (PDF) document

  • PDF/A: PDF document in archiving format PDF/A-1b according to ISO 19005-1 ; see note below

  • PS: PostScript file

For the PDF/A option, Apache FOP 1.0 explicitly requires each text block within the FO document to specify a font using the font-family attribute. In addition, all fonts used must be available on the system during PDF/A generation.

Creating reports with XSL-FO

With the PDF Creator module, you can dynamically generate documents for print output (reports) at the runtime of a process. A report is a special XSL mapping that transforms XML data and outputs an XML document with XSL-FO statements. The generated XSL-FO document is directly converted to the specified output format by the X4 BPMS and passed on to the subsequent process step.

The X4 BPMS uses Apache FOP as the XSL-FO processor to process the reports.

Graphic files (e.g. GIF, JPEG, PNG, SVG) can be integrated into the report document via the XSL-FO element <fo:external-graphic src="url('Pfad/zur/Datei.png')">. To include graphics from the X4 BPMS repository, you can specify their path with an XStore:/ URL, for example:

HTML/XML
<fo:external-graphic src="url('xstore://Project/Folder/File.png')" 
    content-width="10mm" content-height="10mm"/>

The optional attributes content-width and content-height allow you to determine the width and height of the image in the output document.

Alternatively, you can embed binary graphics files as a Base64-encoded string in the report according to the following pattern. For more information, see Base64 Converter .

HTML/XML
<fo:external-graphic src="url(data:;base64,Base64-kodierte Bilddaten)"/>

For SVG images, their source code can also be embedded directly in the report, for example:

HTML/XML
<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>

Make sure that all SVG elements have the svg: namespace.

Example

The following is an example of a very simple (minimal) XSL-FO document:

HTML/XML
<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, visit https://xmlgraphics.apache.org/fop/2.5/hyphenation.html.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.