Package com.itextpdf.text.pdf.parser
Class PdfImageObject
- java.lang.Object
-
- com.itextpdf.text.pdf.parser.PdfImageObject
-
public class PdfImageObject extends java.lang.ObjectAn object that contains an image dictionary and image bytes.- Since:
- 5.0.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPdfImageObject.ImageBytesTypeDifferent types of data that can be stored in the bytes of aPdfImageObject
-
Constructor Summary
Constructors Modifier Constructor Description protectedPdfImageObject(PdfDictionary dictionary, byte[] samples, PdfDictionary colorSpaceDic)Creats a PdfImage object using an explicitly provided dictionary and image bytesPdfImageObject(PRStream stream)Creates a PdfImage object.PdfImageObject(PRStream stream, PdfDictionary colorSpaceDic)Creates a PdfImage object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PdfObjectget(PdfName key)Returns an entry from the image dictionary.java.awt.image.BufferedImagegetBufferedImage()PdfDictionarygetDictionary()Returns the image dictionary.java.lang.StringgetFileType()byte[]getImageAsBytes()PdfImageObject.ImageBytesTypegetImageBytesType()
-
-
-
Constructor Detail
-
PdfImageObject
public PdfImageObject(PRStream stream) throws java.io.IOException
Creates a PdfImage object.- Parameters:
stream- a PRStream- Throws:
java.io.IOException
-
PdfImageObject
public PdfImageObject(PRStream stream, PdfDictionary colorSpaceDic) throws java.io.IOException
Creates a PdfImage object.- Parameters:
stream- a PRStreamcolorSpaceDic- a color space dictionary- Throws:
java.io.IOException
-
PdfImageObject
protected PdfImageObject(PdfDictionary dictionary, byte[] samples, PdfDictionary colorSpaceDic) throws java.io.IOException
Creats a PdfImage object using an explicitly provided dictionary and image bytes- Parameters:
dictionary- the dictionary for the imagesamples- the samplescolorSpaceDic- a color space dictionary- Throws:
java.io.IOException- Since:
- 5.0.3
-
-
Method Detail
-
getFileType
public java.lang.String getFileType()
-
getImageBytesType
public PdfImageObject.ImageBytesType getImageBytesType()
- Returns:
- the type of image data that is returned by getImageBytes()
-
get
public PdfObject get(PdfName key)
Returns an entry from the image dictionary.- Parameters:
key- a key- Returns:
- the value
-
getDictionary
public PdfDictionary getDictionary()
Returns the image dictionary.- Returns:
- the dictionary
-
getImageAsBytes
public byte[] getImageAsBytes()
- Returns:
- the bytes of the image (the format will be as specified in
getImageBytesType() - Throws:
java.io.IOException- Since:
- 5.0.4
-
getBufferedImage
public java.awt.image.BufferedImage getBufferedImage() throws java.io.IOException- Throws:
java.io.IOException- Since:
- 5.0.3 renamed from getAwtImage()
-
-