Class PDCcitt
java.lang.Object
org.apache.pdfbox.pdmodel.graphics.xobject.PDXObject
org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage
org.apache.pdfbox.pdmodel.graphics.xobject.PDCcitt
- All Implemented Interfaces:
COSObjectable
An image class for CCITT Fax.
- Author:
- Ben Litchfield, paul king
-
Field Summary
Fields inherited from class org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage
SUB_TYPE
-
Constructor Summary
ConstructorsConstructorDescriptionStandard constructor.PDCcitt
(PDDocument doc, RandomAccess raf) Construct from a tiff file.PDCcitt
(PDDocument doc, RandomAccess raf, int number) Construct from a tiff file. -
Method Summary
Modifier and TypeMethodDescriptionReturns an image of the CCITT Fax, or null if TIFFs are not supported.void
This writes a tiff to out.Methods inherited from class org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage
applyMasks, createThumbnailXObject, getBitsPerComponent, getColorSpace, getDecode, getHeight, getImageMask, getMask, getSMaskImage, getStencilColor, getSuffix, getWidth, hasMask, imageMask, mask, setBitsPerComponent, setColorSpace, setHeight, setStencilColor, setWidth, write2file, write2file
Methods inherited from class org.apache.pdfbox.pdmodel.graphics.xobject.PDXObject
clear, commonXObjectCreation, createXObject, getCOSObject, getCOSStream, getMetadata, getPDStream, getStructParent, setMetadata, setStructParent
-
Constructor Details
-
PDCcitt
Standard constructor.- Parameters:
ccitt
- The PDStream that already contains all ccitt information.
-
PDCcitt
public PDCcitt(PDDocument doc, RandomAccess raf, int number) throws IOException, IllegalArgumentException Construct from a tiff file.- Parameters:
doc
- The document to create the image as part of.raf
- The random access TIFF file which contains a suitable CCITT compressed imagenumber
- TIFF image number, starting from 0- Throws:
IOException
- If there is an error reading the tiff data.IllegalArgumentException
- If there is no such image number
-
PDCcitt
Construct from a tiff file.- Parameters:
doc
- The document to create the image as part of.raf
- The random access TIFF file which contains a suitable CCITT compressed image- Throws:
IOException
- If there is an error reading the tiff data.
-
-
Method Details
-
getRGBImage
Returns an image of the CCITT Fax, or null if TIFFs are not supported. (Requires additional JAI Image filters ) Returns an java.awt.Image, that can be used for display etc.- Specified by:
getRGBImage
in classPDXObjectImage
- Returns:
- This PDF object as an AWT image.
- Throws:
IOException
- If there is an error creating the image.
-
write2OutputStream
This writes a tiff to out. Writes the Image to out.- Specified by:
write2OutputStream
in classPDXObjectImage
- Parameters:
out
- the OutputStream that the Image is written to.- Throws:
IOException
- when somethings wrong with out
-