Class LosslessFactory
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.graphics.image.LosslessFactory
-
public final class LosslessFactory extends Object
Factory for creating a PDImageXObject containing a lossless compressed image.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PDImageXObjectcreateFromImage(PDDocument document, Bitmap image)Creates a new lossless encoded image XObject from a Bitmap.
-
-
-
Method Detail
-
createFromImage
public static PDImageXObject createFromImage(PDDocument document, Bitmap image) throws IOException
Creates a new lossless encoded image XObject from a Bitmap.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 withPDImageXObject.getColorSpace()andPDImageXObject.setColorSpace()- Parameters:
document- the document where the image will be createdimage- the Bitmap to embed- Returns:
- a new image XObject
- Throws:
IOException- if something goes wrong
-
-