com.itextpdf.text.pdf.parser
public class PdfImageObject extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
fileType |
static String |
TYPE_JP2 |
static String |
TYPE_JPG |
static String |
TYPE_PNG |
static String |
TYPE_TIF |
Modifier | Constructor and Description |
---|---|
protected |
PdfImageObject(PdfDictionary dictionary,
byte[] samples)
Creats a PdfImage object using an explicitly provided dictionary and image bytes
|
|
PdfImageObject(PRStream stream)
Creates a PdfImage object.
|
Modifier and Type | Method and Description |
---|---|
PdfObject |
get(PdfName key)
Returns an entry from the image dictionary.
|
BufferedImage |
getBufferedImage() |
PdfDictionary |
getDictionary()
Returns the image dictionary.
|
String |
getFileType() |
byte[] |
getImageAsBytes() |
byte[] |
getStreamBytes()
Returns the image bytes.
|
public static final String TYPE_PNG
public static final String TYPE_JPG
public static final String TYPE_JP2
public static final String TYPE_TIF
protected String fileType
public PdfImageObject(PRStream stream) throws IOException
stream
- a PRStreamIOException
protected PdfImageObject(PdfDictionary dictionary, byte[] samples) throws IOException
dictionary
- the dictionary for the imagesamples
- the samplesIOException
public String getFileType()
public PdfObject get(PdfName key)
key
- a keypublic PdfDictionary getDictionary()
public byte[] getStreamBytes()
public byte[] getImageAsBytes() throws IOException
IOException
public BufferedImage getBufferedImage() throws IOException
IOException