cnv.ConvertDocument
This job converts one or more document files of the specified format into one or more PDF or TIFF files. Accordingly, arbitrary input and output formats are also possible depending on the respective configurations.
The following classes of transformations are possible:
-
Bitmap format (JPG, TIF) → PDF
-
Singlepage TIFF → Multipage TIFF
-
ASCII-COLD (
.asc) → TIFF / PDF -
XSL:FO (
.fo,.xml) → PDF -
Office documents (
.ps,.doc,.xls,.ppt,.txt,.rtf,.pdf,.ima) → PDF
For bitmap formats and ASCII-COLD documents, Flags can be used to control whether a separate output file should be created for each input file or whether the individual pages should be consolidated into a single document.
Format specifications are expected in lowercase (e.g. pdf instead of PDF).
|
If ObjectID and ObjectType are passed, conversion is performed via OS RenditionPlus (___ren.bat).
The target format can then additionally be SLIDE for preview generation or TXT for text recognition.
The size of the generated preview can be specified with Height and Width.
|
1. Input Parameters
| Name | Type | Required | Description |
|---|---|---|---|
|
INT |
Yes |
|
|
STRING |
Yes |
Format of the source file |
|
STRING |
Yes |
Format to convert to |
|
INT |
No |
Maximum time in milliseconds that a conversion by external programs may take. Considered for XSL:FO and office format conversions. |
|
INT |
Yes |
|
|
INT |
No |
Default |
|
INT |
No |
Default |
|
INT |
No |
Document object ID for use in watermarks.
Only relevant when |
|
INT |
No |
Default |
|
INT |
No |
ID of the document (alternative to file list) |
|
INT |
No |
Type of the object (alternative to file list) |
|
STRING |
No |
Hash value of the document (only when passing |
|
INT |
No |
Height of the preview when destination format is |
|
INT |
No |
Width of the preview when destination format is |
2. Input Files
| Name | Description |
|---|---|
|
Path and name of files to be converted (alternative to |
4. Return Value
(INT): 0 = Job successful, otherwise error code.
See also: cnv.CreateSlide
5. Using XSL:FO
-
For converting FO files (Formatting Objects), the Apache FOP processor must be installed. This requires a Java runtime environment 1.6 or higher. The path to the FOP batch file (Windows) or FOP shell script (Linux) must be stored in the registry via the Enterprise Manager. Additionally, a timeout can be defined after which the conversion process is aborted.
-
If an XML document is passed to FOP, an XSLT document must be passed as a second file in the input file list to transform the XML into an XSL:FO document.
-
If images are to be included in the resulting PDF, they must be referenced in the XSL:FO file via a URL accessible to the application server.
-
Only one FO or XML document can be processed per job.
-
Input file — XML file with arbitrary input information:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> <?xml-stylesheet type="text/xsl" href="example.fo"?> <persons> <person age="42">Max Mustermann</person> <person age="37">Denise Musterfrau</person> </persons> -
Input file — XSL file for converting to an XSL:FO file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<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="persons">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master page-master-name="one" page-height="29cm" page-width="21cm"
margin-left="2cm" margin-right="2cm">
<fo:region-body margin-top="50pt" margin-bottom="50pt"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:block text-align="center" font-size="24pt" font-weight="bold"
lineheight="28pt" space-after="10mm">
<xsl:apply-templates/>
</fo:block>
</fo:root>
</xsl:template>
<xsl:template match="person">
...
</xsl:template>
</xsl:stylesheet>