public final class LosslessFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static PDImageXObject |
createFromImage(BufferedImage image)
Creates a new lossless encoded image XObject from a BufferedImage.
|
public static PDImageXObject createFromImage(BufferedImage image) throws IOException
New for advanced users from 2.0.12 on:
If you created your image with a non standard ICC colorspace, it will be preserved. (If you load images in java
using ImageIO then no need to read this segment) However a new colorspace will be created for each image. So if
you create a PDF with several such images, consider replacing the colorspace with a common object to save space.
This is done with PDImageXObject.getColorSpace() and
PDImageXObject.setColorSpace()
document - the document where the image will be createdimage - the BufferedImage to embedIOException - if something goes wrongCopyright © 2020 sejda. All rights reserved.