com.itextpdf.text.pdf.parser
Class PdfImageObject

java.lang.Object
  extended by com.itextpdf.text.pdf.parser.PdfImageObject

public class PdfImageObject
extends Object

An object that contains an image dictionary and image bytes.

Since:
5.0.2

Field Summary
protected  String fileType
           
static String TYPE_JP2
           
static String TYPE_JPG
           
static String TYPE_PNG
           
static String TYPE_TIF
           
 
Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_PNG

public static final String TYPE_PNG
See Also:
Constant Field Values

TYPE_JPG

public static final String TYPE_JPG
See Also:
Constant Field Values

TYPE_JP2

public static final String TYPE_JP2
See Also:
Constant Field Values

TYPE_TIF

public static final String TYPE_TIF
See Also:
Constant Field Values

fileType

protected String fileType
Constructor Detail

PdfImageObject

public PdfImageObject(PRStream stream)
               throws IOException
Creates a PdfImage object.

Parameters:
stream - a PRStream
Throws:
IOException

PdfImageObject

protected PdfImageObject(PdfDictionary dictionary,
                         byte[] samples)
                  throws IOException
Creats a PdfImage object using an explicitly provided dictionary and image bytes

Parameters:
dictionary - the dictionary for the image
samples - the samples
Throws:
IOException
Since:
5.0.3
Method Detail

getFileType

public String getFileType()

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

getStreamBytes

public byte[] getStreamBytes()
Returns the image bytes.

Returns:
the streamBytes

getImageAsBytes

public byte[] getImageAsBytes()
                       throws IOException
Throws:
IOException

getBufferedImage

public BufferedImage getBufferedImage()
                               throws IOException
Throws:
IOException
Since:
5.0.3 renamed from getAwtImage()