public final class JPEGFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static PDImageXObject |
createFromFile(File file)
Creates a new JPEG Image XObject from an input stream containing JPEG data.
|
static PDImageXObject |
createFromImage(BufferedImage image)
Creates a new JPEG Image XObject from a Buffered Image.
|
static PDImageXObject |
createFromImage(BufferedImage image,
float quality)
Creates a new JPEG Image XObject from a Buffered Image and a given quality.
|
static PDImageXObject |
createFromImage(BufferedImage image,
float quality,
int dpi)
Creates a new JPEG Image XObject from a Buffered Image, a given quality and DPI.
|
static PDColorSpace |
getColorSpaceFromAWT(BufferedImage awtImage) |
static BufferedImage |
readJpegFile(File file) |
public static PDImageXObject createFromFile(File file) throws IOException
file - a JPEG fileIOException - if the input stream cannot be readpublic static BufferedImage readJpegFile(File file) throws IOException
IOExceptionpublic static PDImageXObject createFromImage(BufferedImage image) throws IOException
image - the buffered image to embedIOException - if the JPEG data cannot be writtenpublic static PDImageXObject createFromImage(BufferedImage image, float quality) throws IOException
image - the buffered image to embedquality - the desired JPEG compression qualityIOException - if the JPEG data cannot be writtenpublic static PDImageXObject createFromImage(BufferedImage image, float quality, int dpi) throws IOException
image - the buffered image to embedquality - the desired JPEG compression qualitydpi - the desired DPI (resolution) of the JPEGIOException - if the JPEG data cannot be writtenpublic static PDColorSpace getColorSpaceFromAWT(BufferedImage awtImage)
Copyright © 2019 sejda. All rights reserved.