java.lang.Object
org.sejda.sambox.pdmodel.graphics.image.CCITTFactory
Factory for creating a PDImageXObject containing a CCITT Fax compressed TIFF image.
- Author:
- Ben Litchfield, Paul King
-
Method Summary
Modifier and TypeMethodDescriptionstatic PDImageXObjectcreateFromFile(File file) Creates a new CCITT Fax compressed Image XObject from the first page of a TIFF file.static PDImageXObjectcreateFromFile(File file, int number) Creates a new CCITT Fax compressed Image XObject from the first page of a TIFF file.static PDImageXObjectcreateFromImage(BufferedImage image) Creates a new CCITT group 4 (T6) compressed image XObject from a b/w BufferedImage.static PDImageXObjectcreateFromSeekableSource(org.sejda.io.SeekableSource source) static PDImageXObjectcreateFromSeekableSource(org.sejda.io.SeekableSource source, int number)
-
Method Details
-
createFromImage
Creates a new CCITT group 4 (T6) compressed image XObject from a b/w BufferedImage. This compression technique usually results in smaller images than those produced byLosslessFactory#createFromImage(PDDocument, BufferedImage).- Parameters:
image- the image.- Returns:
- a new image XObject.
- Throws:
IOException- if there is an error creating the image.IllegalArgumentException- if the BufferedImage is not a b/w image.
-
createFromFile
Creates a new CCITT Fax compressed Image XObject from the first page of a TIFF file.- Parameters:
file- the TIFF file which contains a suitable CCITT compressed image- Returns:
- a new Image XObject
- Throws:
IOException- if there is an error reading the TIFF data.
-
createFromFile
Creates a new CCITT Fax compressed Image XObject from the first page of a TIFF file.- Parameters:
file- the TIFF file which contains a suitable CCITT compressed imagenumber- TIFF image number, starting from 0- Returns:
- a new Image XObject
- Throws:
IOException- if there is an error reading the TIFF data.
-
createFromSeekableSource
public static PDImageXObject createFromSeekableSource(org.sejda.io.SeekableSource source) throws IOException - Throws:
IOException
-
createFromSeekableSource
public static PDImageXObject createFromSeekableSource(org.sejda.io.SeekableSource source, int number) throws IOException - Throws:
IOException
-