public final class CCITTFactory
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
CCITTFactory() |
Modifier and Type | Method and Description |
---|---|
static PDImageXObject |
createFromByteArray(PDDocument document,
byte[] byteArray)
Creates a new CCITT Fax compressed image XObject from a specific image of a TIFF file stored
in a byte array.
|
static PDImageXObject |
createFromByteArray(PDDocument document,
byte[] byteArray,
int number)
Creates a new CCITT Fax compressed image XObject from a specific image of a TIFF file stored
in a byte array.
|
static PDImageXObject |
createFromFile(PDDocument document,
java.io.File file)
Creates a new CCITT Fax compressed image XObject from the first image of a TIFF file.
|
static PDImageXObject |
createFromFile(PDDocument document,
java.io.File file,
int number)
Creates a new CCITT Fax compressed image XObject from a specific image of a TIFF file.
|
static PDImageXObject |
createFromImage(PDDocument document,
java.awt.image.BufferedImage image)
Creates a new CCITT group 4 (T6) compressed image XObject from a b/w BufferedImage.
|
static PDImageXObject |
createFromRandomAccess(PDDocument document,
RandomAccess reader)
Deprecated.
Use
createFromFile(PDDocument, File) instead. |
static PDImageXObject |
createFromRandomAccess(PDDocument document,
RandomAccess reader,
int number)
Deprecated.
Use
createFromFile(PDDocument, File, int) instead. |
private static PDImageXObject |
createFromRandomAccessImpl(PDDocument document,
RandomAccess reader,
int number)
Creates a new CCITT Fax compressed image XObject from a TIFF file.
|
private static void |
extractFromTiff(RandomAccess reader,
java.io.OutputStream os,
COSDictionary params,
int number) |
private static PDImageXObject |
prepareImageXObject(PDDocument document,
byte[] byteArray,
int width,
int height,
PDColorSpace initColorSpace) |
private static int |
readlong(char endianess,
RandomAccess raf) |
private static int |
readshort(char endianess,
RandomAccess raf) |
public static PDImageXObject createFromImage(PDDocument document, java.awt.image.BufferedImage image) throws java.io.IOException
LosslessFactory.createFromImage(PDDocument, BufferedImage)
.document
- the document to create the image as part of.image
- the image.java.io.IOException
- if there is an error creating the image.java.lang.IllegalArgumentException
- if the BufferedImage is not a b/w image.public static PDImageXObject createFromByteArray(PDDocument document, byte[] byteArray) throws java.io.IOException
LosslessFactory.createFromImage(PDDocument, BufferedImage)
or createFromImage(PDDocument, BufferedImage)
instead.document
- the document to create the image as part of.byteArray
- the TIFF file in a byte array which contains a suitable CCITT compressed
imagejava.io.IOException
- if there is an error reading the TIFF data.public static PDImageXObject createFromByteArray(PDDocument document, byte[] byteArray, int number) throws java.io.IOException
LosslessFactory.createFromImage(PDDocument, BufferedImage)
or createFromImage(PDDocument, BufferedImage)
instead.document
- the document to create the image as part of.byteArray
- the TIFF file in a byte array which contains a suitable CCITT compressed
imagenumber
- TIFF image number, starting from 0java.io.IOException
- if there is an error reading the TIFF data.private static PDImageXObject prepareImageXObject(PDDocument document, byte[] byteArray, int width, int height, PDColorSpace initColorSpace) throws java.io.IOException
java.io.IOException
@Deprecated public static PDImageXObject createFromRandomAccess(PDDocument document, RandomAccess reader) throws java.io.IOException
createFromFile(PDDocument, File)
instead.document
- the document to create the image as part of.reader
- the random access TIFF file which contains a suitable CCITT
compressed imagejava.io.IOException
- if there is an error reading the TIFF data.@Deprecated public static PDImageXObject createFromRandomAccess(PDDocument document, RandomAccess reader, int number) throws java.io.IOException
createFromFile(PDDocument, File, int)
instead.document
- the document to create the image as part of.reader
- the random access TIFF file which contains a suitable CCITT
compressed imagenumber
- TIFF image number, starting from 0java.io.IOException
- if there is an error reading the TIFF data.public static PDImageXObject createFromFile(PDDocument document, java.io.File file) throws java.io.IOException
LosslessFactory.createFromImage(org.apache.pdfbox.pdmodel.PDDocument, java.awt.image.BufferedImage)
or createFromImage(PDDocument, BufferedImage)
instead.document
- the document to create the image as part of.file
- the TIFF file which contains a suitable CCITT compressed imagejava.io.IOException
- if there is an error reading the TIFF data.public static PDImageXObject createFromFile(PDDocument document, java.io.File file, int number) throws java.io.IOException
LosslessFactory.createFromImage(PDDocument, BufferedImage)
or createFromImage(PDDocument, BufferedImage)
instead.document
- the document to create the image as part of.file
- the TIFF file which contains a suitable CCITT compressed imagenumber
- TIFF image number, starting from 0java.io.IOException
- if there is an error reading the TIFF data.private static PDImageXObject createFromRandomAccessImpl(PDDocument document, RandomAccess reader, int number) throws java.io.IOException
document
- the document to create the image as part of.reader
- the random access TIFF file which contains a suitable CCITT
compressed imagenumber
- TIFF image number, starting from 0java.io.IOException
- if there is an error reading the TIFF data.private static void extractFromTiff(RandomAccess reader, java.io.OutputStream os, COSDictionary params, int number) throws java.io.IOException
java.io.IOException
private static int readshort(char endianess, RandomAccess raf) throws java.io.IOException
java.io.IOException
private static int readlong(char endianess, RandomAccess raf) throws java.io.IOException
java.io.IOException