public final class JPEGFactory extends Object
Modifier and Type | Method and Description |
---|---|
static PDImageXObject |
createFromImage(PDDocument document,
BufferedImage image)
Creates a new JPEG Image XObject from a Buffered Image.
|
static PDImageXObject |
createFromImage(PDDocument document,
BufferedImage image,
float quality)
Creates a new JPEG Image XObject from a Buffered Image and a given quality.
|
static PDImageXObject |
createFromImage(PDDocument document,
BufferedImage image,
float quality,
int dpi)
Creates a new JPEG Image XObject from a Buffered Image, a given quality and DPI.
|
static PDImageXObject |
createFromStream(PDDocument document,
InputStream stream)
Creates a new JPEG Image XObject from an input stream containing JPEG data.
|
public static PDImageXObject createFromStream(PDDocument document, InputStream stream) throws IOException
document
- the document where the image will be createdstream
- a stream of JPEG dataIOException
- if the input stream cannot be readpublic static PDImageXObject createFromImage(PDDocument document, BufferedImage image) throws IOException
document
- the document where the image will be createdimage
- the buffered image to embedIOException
- if the JPEG data cannot be writtenpublic static PDImageXObject createFromImage(PDDocument document, BufferedImage image, float quality) throws IOException
document
- the document where the image will be createdimage
- the buffered image to embedquality
- the desired JPEG compression qualityIOException
- if the JPEG data cannot be writtenpublic static PDImageXObject createFromImage(PDDocument document, BufferedImage image, float quality, int dpi) throws IOException
document
- the document where the image will be createdimage
- the buffered image to embedquality
- the desired JPEG compression qualitydpi
- the desired DPI (resolution) of the JPEGIOException
- if the JPEG data cannot be writtenCopyright © 2002–2016 The Apache Software Foundation. All rights reserved.