org.pdfbox.pdmodel.graphics.xobject

Class PDJpeg

Implemented Interfaces:
COSObjectable

public class PDJpeg
extends PDXObjectImage

An image class for JPegs.
Version:
$Revision: 1.5 $
Author:
mathiak

Field Summary

Fields inherited from class org.pdfbox.pdmodel.graphics.xobject.PDXObjectImage

SUB_TYPE

Constructor Summary

PDJpeg(PDDocument doc, BufferedImage bi)
Construct from a buffered image.
PDJpeg(PDDocument doc, InputStream is)
Construct from a stream.
PDJpeg(PDStream jpeg)
Standard constructor.

Method Summary

BufferedImage
getRGBImage()
Returns an image of the JPeg, or null if JPegs are not supported.
void
write2OutputStream(OutputStream out)
This writes the JPeg to out.

Methods inherited from class org.pdfbox.pdmodel.graphics.xobject.PDXObjectImage

getBitsPerComponent, getColorSpace, getHeight, getRGBImage, getSuffix, getWidth, setBitsPerComponent, setColorSpace, setHeight, setWidth, write2OutputStream, write2file

Methods inherited from class org.pdfbox.pdmodel.graphics.xobject.PDXObject

createXObject, getCOSObject, getCOSStream, getMetadata, getPDStream, setMetadata

Constructor Details

PDJpeg

public PDJpeg(PDDocument doc,
              BufferedImage bi)
            throws IOException
Construct from a buffered image.
Parameters:
doc - The document to create the image as part of.
bi - The image to convert to a jpeg

PDJpeg

public PDJpeg(PDDocument doc,
              InputStream is)
            throws IOException
Construct from a stream.
Parameters:
doc - The document to create the image as part of.
is - The stream that contains the jpeg data.

PDJpeg

public PDJpeg(PDStream jpeg)
Standard constructor.
Parameters:
jpeg - The COSStream from which to extract the JPeg

Method Details

getRGBImage

public BufferedImage getRGBImage()
            throws IOException
Returns an image of the JPeg, or null if JPegs are not supported. (They should be. )
Overrides:
getRGBImage in interface PDXObjectImage

write2OutputStream

public void write2OutputStream(OutputStream out)
            throws IOException
This writes the JPeg to out.
Overrides:
write2OutputStream in interface PDXObjectImage