3-Heights™ Document Converter, Version 4.6
Page 64 of 90
January 25, 2016
© PDF Tools AG - Premium PDF Technology
5.4.5 Document Transformations
Document transformations can be used to process an input document in a special way
prior to further conversion via the standard built-in components of the converter
service. This can be used in various ways, e.g.
• Apply an XSL transformation on an XML file to produce HTML that can then be
converted via MS Word or Internet Explorer
• Use the source document to extract parameter data, and prepare a report from
data in a database
The converter service will perform transformations when the document option
“TRANSFORM=value” is applied. The ‘value’ string is either the name of a VBS script
located in the installation directory of the converter service, or an arbitrary command
that can be executed by Windows. To prevent security problems, the commands that
are permitted must be configured in the [Options] section of the O2PWSC.ini file:
AllowedTransforms = xsl.vbs : doXml.exe : ApplyXSL.exe *
The value passed along with the TRANSFORM option will be validated against the value
string for AllowedTransforms. There must be an exact (case sensitive) match for the
string part preceding the ‘*’ character, otherwise, an error will be raised, and the
conversion will fail. The * placeholder allows you to pass additional parameters to the
transformation tool which may vary from document to document. The colon character is
used to separate valid alternatives (spaces before or after the separator are ignored).
The converter service will append the path name of the input document as the last
When a VBS script is specified with the TRANSFORM option (e.g. TRANSFORM=t1.vbs),
it is executed via cscript.exe. No extra parameters can be passed.
In any case, the transformation command shall write to output a line starting with
“Output: “, followed by the full name path of the file that has been created as the result
of the transformation. The converter service will continue by converting this file rather
than the original input file. After conversion, the file will be deleted.
Transformations (see previous section) can be used to pre-process documents before
they proceed to conversion to PDF or TIFF. The optimization of the resulting PDF
document however must be performed towards the end of the conversion process, prior
to digital signing. As of version 4.6 of the Document Converter, it is thus possible to
optionally apply a PDF optimization command using the “PDFOPTMIZE” job option.
To make use of this feature, you must prepare one or several profiles. A profile specifies
which external tool shall be executed, and with which options shall be added to its
Let us assume the O2PWSC.ini configuration file contains the following lines:
archive = -or -od -st -dt 200 -dr 200 -fb 6,7,10 -fc 1,8,10 -fi 2,10 -m -s –oc
exepath = PDFOPTIMIZE.EXE