PDF to image converter
Availability
Orbeon Forms 2016.1 and newer.
Introduction
This processor converts a PDF document into a single image document.
When the output format is TIFF, the processor creates a multi-page TIFF containing one page for each page in the PDF document. For other output formats, only the first page of the PDF document is used and a single image is created.
When using the TIFF format, if the destination format is bitonal (black and white), dithering is applied.
Basic usage example
<p:processor name="oxf:pdf-to-image">
<p:input name="data" href="#pdf-data"/>
<p:input name="config">
<config>
<format>tiff</format>
<compression>
<type>LZW</type>
<quality>0.8</quality>
</compression>
<scale>2.0</scale>
</config>
</p:input>
<p:output name="data" id="image-data"/>
</p:processor>Inputs and outputs
datainput: receives the PDF document to convert as a binary document.configinput: receives the configuration of the transformation.dataoutput: produces the resulting image as a binary document.
The config input supports the following elements:
format:one of
gif,png,jpeg, ortiffmandatory
scale:scaling factor
optional
defaults to
1.0
compressioncompression settings
optional
typechild elementonly meaningful for
tiffformatone of
CCITT RLE,CCITT T.4,CCITT T.6,LZW,JPEG,ZLib,PackBits,Deflate,EXIF JPEGornonedefaults to
none
qualitychild elementonly meaningful for
gif,jpegandtiffformatsvalue is a double-precision number from
0.0to1.0
Examples of configurations
GIF output:
<config>
<format>gif</format>
<scale>3.0</scale>
<compression>
<quality>0.5</quality>
</compression>
</config>JPEG output:
<config>
<format>jpeg</format>
<scale>3.0</scale>
<compression>
<quality>1.0</quality>
</compression>
</config>PNG output:
<config>
<format>png</format>
<scale>3.0</scale>
</config>Black and white TIFF output with "CCITT T.6" compression:
<config>
<scale>3.0</scale>
<format>tiff</format>
<compression>
<type>CCITT T.6</type>
<quality>0.5</quality>
</compression>
</config>Uncompressed TIFF output:
<config>
<scale>3.0</scale>
<format>tiff</format>
<compression>
<type>none</type>
</compression>
</config>Compressed TIFF output with LZW compression:
<config>
<scale>3.0</scale>
<format>tiff</format>
<compression>
<type>LZW</type>
<quality>1.0</quality>
</compression>
</config>