com.qoppa.pdf
Class TIFFOptions

java.lang.Object
  extended by com.qoppa.pdf.TIFFOptions

public class TIFFOptions
extends Object

Options used for finer control of the TIFF output format. This object is used when additional options, such as the byte order, need to be specified when saving PDF pages as TIFF images.

Author:
Qoppa Software

Field Summary
static int DITHER_FLOYD_STEINBERG
          Use Floyd-Steinberg dithering when converting to B&W
static int DITHER_NONE
          Do not dither output B&W images
static String TIFF_CCITT_RLE
          TIFF CCITT Modified Huffman RLE compression.
static String TIFF_CCITT_T4
          TIFF CCITT Group 3 fax encoding.
static String TIFF_CCITT_T6
          TIFF CCITT Group 4 fax encoding.
static String TIFF_DEFLATE
          TIFF Deflate lossless compression (Zip-in-TIFF).
static String TIFF_FAX_GROUP3
          TIFF CCITT Group 3 fax encoding.
static String TIFF_FAX_GROUP4
          TIFF CCITT Group 4 fax encoding.
static String TIFF_JPEG
          TIFF JPEG-in-TIFF compression.
static String TIFF_LZW
          TIFF LZW Compression
static String TIFF_NO_COMPRESSION
          TIFF with no compression.
static String TIFF_PACKBITS
          TIFF Byte-oriented run-length encoding "PackBits" compression.
static String TIFF_ZLIB
          TIFF ZLib Compression.
 
Constructor Summary
TIFFOptions(int dpi, String compression)
          TIFFOptions constructor that allows setting of DPI and compression format.
 
Method Summary
 ByteOrder getByteOrder()
          Gets the byte order to use when saving a TIFF file.
 String getCompression()
          Return the current compression setting fo this TIFFOptions.
 int getDitherBW()
          Gets the dithering option when converting images to black and white.
 int getDPI()
          Return the DPI setting for this TIFFOptions.
 float getJPEGQuality()
          Gets the current setting for the JPEG quality.
 int getRowsPerStrip()
          Returns the number of rows per strip that will be used when saving a TIFF file.
 boolean isGrayscale()
          Returns a flag indicating whether the document should be converted to grayscale before writing the output TIFF file.
 void setByteOrder(ByteOrder byteOrder)
          Sets the byte order to use when saving a TIFF file.
 void setDitherBW(int ditherBW)
          Sets the dithering option when converting images to black and white.
 void setGrayscale(boolean grayscale)
          Sets the grayscale flag.
 void setJPEGQuality(float jpegQuality)
          Sets the JPEG quality to be used when saving a JPEG compressed TIFF file.
 void setRowsPerStrip(int rowsPerStrip)
          Sets the number of rows per strip to use when writing the TIFF file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIFF_DEFLATE

public static final String TIFF_DEFLATE
TIFF Deflate lossless compression (Zip-in-TIFF).

See Also:
Constant Field Values

TIFF_CCITT_RLE

public static final String TIFF_CCITT_RLE
TIFF CCITT Modified Huffman RLE compression.

See Also:
Constant Field Values

TIFF_CCITT_T4

public static final String TIFF_CCITT_T4
TIFF CCITT Group 3 fax encoding.

See Also:
Constant Field Values

TIFF_FAX_GROUP3

public static final String TIFF_FAX_GROUP3
TIFF CCITT Group 3 fax encoding.

See Also:
Constant Field Values

TIFF_CCITT_T6

public static final String TIFF_CCITT_T6
TIFF CCITT Group 4 fax encoding.

See Also:
Constant Field Values

TIFF_FAX_GROUP4

public static final String TIFF_FAX_GROUP4
TIFF CCITT Group 4 fax encoding.

See Also:
Constant Field Values

TIFF_JPEG

public static final String TIFF_JPEG
TIFF JPEG-in-TIFF compression.

See Also:
Constant Field Values

TIFF_LZW

public static final String TIFF_LZW
TIFF LZW Compression

See Also:
Constant Field Values

TIFF_PACKBITS

public static final String TIFF_PACKBITS
TIFF Byte-oriented run-length encoding "PackBits" compression.

See Also:
Constant Field Values

TIFF_ZLIB

public static final String TIFF_ZLIB
TIFF ZLib Compression.

See Also:
Constant Field Values

TIFF_NO_COMPRESSION

public static final String TIFF_NO_COMPRESSION
TIFF with no compression.


DITHER_NONE

public static final int DITHER_NONE
Do not dither output B&W images

See Also:
Constant Field Values

DITHER_FLOYD_STEINBERG

public static final int DITHER_FLOYD_STEINBERG
Use Floyd-Steinberg dithering when converting to B&W

See Also:
Constant Field Values
Constructor Detail

TIFFOptions

public TIFFOptions(int dpi,
                   String compression)
TIFFOptions constructor that allows setting of DPI and compression format.

Parameters:
dpi - Dots per inch at which to render the image, 72 is the native PDF resolution and is equivalent to 100% scale..
compression - The type of TIFF compression to use. This value needs to be one of these predefined values:

TIFFOptions.TIFF_DEFLATE - Deflate lossless compression (Zip-in-TIFF)
TIFFOptions.TIFF_CCITT_RLE - CCITT Modified Huffman RLE
TIFFOptions.TIFF_CCITT_T4 - CCITT Group 3 fax encoding
TIFFOptions.TIFF_CCITT_T6 - CCITT Group 4 fax encoding
TIFFOptions.TIFF_JPEG - JPEG-in-TIFF compression.
TIFFOptions.TIFF_LZW - LZW Compression
TIFFOptions.TIFF_PACKBITS - Byte-oriented run-length encoding "PackBits" compression.
TIFFOptions.TIFF_ZLIB - ZLib Compression.
TIFFOptions.TIFF_NO_COMPRESSION - No compression.
Method Detail

getDPI

public int getDPI()
Return the DPI setting for this TIFFOptions.

Returns:
The current DPI setting.

getCompression

public String getCompression()
Return the current compression setting fo this TIFFOptions.

Returns:
The current compression setting.

getByteOrder

public ByteOrder getByteOrder()
Gets the byte order to use when saving a TIFF file.

Returns:
The byte order

setByteOrder

public void setByteOrder(ByteOrder byteOrder)
Sets the byte order to use when saving a TIFF file.

Parameters:
byteOrder - The byte order to use, this can be either ByteOrder.BIG_ENDIAN or BYTEOrder.LITTLE_ENDIAN.

setRowsPerStrip

public void setRowsPerStrip(int rowsPerStrip)
Sets the number of rows per strip to use when writing the TIFF file. When this value is set, the TIFF file will be a multi-strip file using this value for the number of rows per strip.

Parameters:
rowsPerStrip - The number of rows per strip in the output file. Use -1 to output the file as a single strip file.

getRowsPerStrip

public int getRowsPerStrip()
Returns the number of rows per strip that will be used when saving a TIFF file.

Returns:
Number of rows per strip. If -1, this means that the TIFF file will be output as a single strip file.

isGrayscale

public boolean isGrayscale()
Returns a flag indicating whether the document should be converted to grayscale before writing the output TIFF file.

Returns:
The value of the grayscale flag.

setGrayscale

public void setGrayscale(boolean grayscale)
Sets the grayscale flag. When this is true, the library will convert the image to grayscale before exporting.

Parameters:
grayscale - The new value of the grayscale flag.

getDitherBW

public int getDitherBW()
Gets the dithering option when converting images to black and white.

Returns:
The current dithering option

setDitherBW

public void setDitherBW(int ditherBW)
Sets the dithering option when converting images to black and white. The possible values for this are DITHER_NONE and DITHER_FLOYD_STEINBERG

Parameters:
ditherBW - The new value of the dithering option

getJPEGQuality

public float getJPEGQuality()
Gets the current setting for the JPEG quality. this is only used when the TIFF file is saved using JPEG compression, with TIFF_JPEG. The value is between 0 and 1.

Returns:
The current setting for the JPEG quality.

setJPEGQuality

public void setJPEGQuality(float jpegQuality)
Sets the JPEG quality to be used when saving a JPEG compressed TIFF file. This value only gets used when the compression type is TIFF_JPEG.

Parameters:
jpegQuality - The JPEG quality setting, should be between 0 and 1.