TiffCompression

Inheritance: java.lang.Object

public class TiffCompression

Specifies what type of compression to apply when saving page images into a TIFF file.

Examples:

Shows how to select the compression scheme to apply to a document that we convert into a TIFF image.


 Document doc = new Document();
 DocumentBuilder builder = new DocumentBuilder(doc);

 builder.insertImage(getImageDir() + "Tagged Image File Format.tiff");

 // Create an "ImageSaveOptions" object which we can pass to the document's "Save" method
 // to modify the way in which that method renders the document into an image.
 ImageSaveOptions options = new ImageSaveOptions(SaveFormat.TIFF);

 // Set the "TiffCompression" property to "TiffCompression.None" to apply no compression while saving,
 // which may result in a very large output file.
 // Set the "TiffCompression" property to "TiffCompression.Rle" to apply RLE compression
 // Set the "TiffCompression" property to "TiffCompression.Lzw" to apply LZW compression.
 // Set the "TiffCompression" property to "TiffCompression.Ccitt3" to apply CCITT3 compression.
 // Set the "TiffCompression" property to "TiffCompression.Ccitt4" to apply CCITT4 compression.
 options.setTiffCompression(tiffCompression);

 doc.save(getArtifactsDir() + "ImageSaveOptions.TiffImageCompression.tiff", options);
 

Fields

FieldDescription
CCITT_3Specifies the CCITT3 compression scheme.
CCITT_4Specifies the CCITT4 compression scheme.
LZWSpecifies the LZW compression scheme.
NONESpecifies no compression.
RLESpecifies the RLE compression scheme.
length

Methods

MethodDescription
fromName(String tiffCompressionName)
getName(int tiffCompression)
getValues()
toString(int tiffCompression)

CCITT_3

public static int CCITT_3

Specifies the CCITT3 compression scheme.

CCITT_4

public static int CCITT_4

Specifies the CCITT4 compression scheme.

LZW

public static int LZW

Specifies the LZW compression scheme. In Java emulated by Deflate (Zip) compression.

NONE

public static int NONE

Specifies no compression.

RLE

public static int RLE

Specifies the RLE compression scheme.

length

public static int length

fromName(String tiffCompressionName)

public static int fromName(String tiffCompressionName)

Parameters:

ParameterTypeDescription
tiffCompressionNamejava.lang.String

Returns: int

getName(int tiffCompression)

public static String getName(int tiffCompression)

Parameters:

ParameterTypeDescription
tiffCompressionint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int tiffCompression)

public static String toString(int tiffCompression)

Parameters:

ParameterTypeDescription
tiffCompressionint

Returns: java.lang.String