Class PDFSurface

java.lang.Object
All Implemented Interfaces:
AutoCloseable

public final class PDFSurface extends Surface
The PDF surface is used to render cairo graphics to Adobe PDF files and is a multi-page vector surface backend.

The following mime types are supported on source patterns: MimeType.JPEG, MimeType.JP2, MimeType.UNIQUE_ID, MimeType.JBIG2, MimeType.JBIG2_GLOBAL, MimeType.JBIG2_GLOBAL_ID, MimeType.CCITT_FAX, MimeType.CCITT_FAX_PARAMS.

JBIG2 Images

JBIG2 data in PDF must be in the embedded format as described in ISO/IEC 11544. Image specific JBIG2 data must be in MimeType.JBIG2. Any global segments in the JBIG2 data (segments with page association field set to 0) must be in MimeType.JBIG2_GLOBAL. The global data may be shared by multiple images. All images sharing the same global data must set MimeType.JBIG2_GLOBAL_ID to a unique identifier. At least one of the images must provide the global data using MimeType.JBIG2_GLOBAL. The global data will only be embedded once and shared by all JBIG2 images with the same MimeType.JBIG2_GLOBAL_ID.

CCITT Fax Images

The MimeType.CCITT_FAX mime data requires a number of decoding parameters These parameters are specified using MimeType.CCITT_FAX_PARAMS.

MimeType.CCITT_FAX_PARAMS mime data must contain a string of the form "param1=value1 param2=value2 ...".

Columns: [required] An integer specifying the width of the image in pixels.

Rows: [required] An integer specifying the height of the image in scan lines.

K: [optional] An integer identifying the encoding scheme used. < 0 is 2 dimensional Group 4, = 0 is Group3 1 dimensional, > 0 is mixed 1 and 2 dimensional encoding. Default is 0.

EndOfLine: [optional] If true end-of-line bit patterns are present. Default is false.

EncodedByteAlign: [optional] If true the end of line is padded with 0 bits so the next line begins on a byte boundary. Default is false.

EndOfBlock: [optional] If true the data contains an end-of-block pattern. Default is true.

BlackIs1: [optional] If true 1 bits are black pixels. Default is false.

DamagedRowsBeforeError: [optional] An integer specifying the number of damages rows tolerated before an error occurs. Default is 0.

Boolean values may be "true" or "false", or 1 or 0.

These parameters are the same as the CCITTFaxDecode parameters in the PostScript Language Reference and Portable Document Format (PDF). Refer to these documents for further details.

An example MimeType.CCITT_FAX_PARAMS string is:

 "Columns=10230 Rows=40000 K=1 EndOfLine=true EncodedByteAlign=1 BlackIs1=false"
 
Since:
1.2
See Also: