multivalent.std.adaptor.pdf

Class Images

public class Images extends Object

Interpret PDF image types, from objects or inline (content stream): DCT (JPEG), CCITT FAX (Group 3, Group 3 2D, Group 4), raw samples (bit depth 1,2,4,8), JBIG2. Does no cacheing; always creates new image.

Version: $Revision: 1.82 $ $Date: 2003/11/29 19:54:44 $

See Also: javax.imageio.* Fax

Method Summary
static BufferedImagecreateImage(Dict imgdict, InputStream in, Color fillcolor, PDFReader pdfr)
Constructs new BufferedImage from dictionary attributes and data in stream.
static BufferedImagecreateScaledImage(Dict imgdict, InputStream in, AffineTransform ctm, Color fillcolor, PDFReader pdfr)
Scale and rotate according to affine transform, adjusting image origin from PDF lower-left to Java upper-left.
static BufferedImagecreateScaledInline(InputStreamComposite in, Dict csres, AffineTransform ctm, Color fillcolor, PDFReader pdfr)
Process inline image into Node.
static DictgetDecodeParms(Dict imgdict, PDFReader pdfr)
Returns image's /DecodeParms, or null if none (or OBJECT_NULL).
static StringgetFilter(Dict imgdict, COSSource coss)
Return image part of filter, which may be in a cascade, or null if none.
static StringgetSuffix(String filter)
Returns file type suffix corresponding to PDF filter, e.g., PDF DCTDecode returns jpg.

Method Detail

createImage

public static BufferedImage createImage(Dict imgdict, InputStream in, Color fillcolor, PDFReader pdfr)
Constructs new BufferedImage from dictionary attributes and data in stream.

Parameters: imgdict image XObject, or Dict with STREAM_DATA key set for inline images

createScaledImage

public static BufferedImage createScaledImage(Dict imgdict, InputStream in, AffineTransform ctm, Color fillcolor, PDFReader pdfr)
Scale and rotate according to affine transform, adjusting image origin from PDF lower-left to Java upper-left.

See Also: Images

createScaledInline

public static BufferedImage createScaledInline(InputStreamComposite in, Dict csres, AffineTransform ctm, Color fillcolor, PDFReader pdfr)
Process inline image into Node.

getDecodeParms

public static Dict getDecodeParms(Dict imgdict, PDFReader pdfr)
Returns image's /DecodeParms, or null if none (or OBJECT_NULL). If /DecodeParms is an array, the one corresponding to the image is always the last array element.

getFilter

public static String getFilter(Dict imgdict, COSSource coss)
Return image part of filter, which may be in a cascade, or null if none. Expands abbreviations ("DCT" => "DCTDecode", "CCF" => "CCITTFaxDecode"). For example, from [ASCII85Decode CCF], returns CCITTFaxDecode.

getSuffix

public static String getSuffix(String filter)
Returns file type suffix corresponding to PDF filter, e.g., PDF DCTDecode returns jpg.