Package com.tom_roush.pdfbox.filter
Class Filter
- java.lang.Object
-
- com.tom_roush.pdfbox.filter.Filter
-
-
Field Summary
Fields Modifier and Type Field Description static StringSYSPROP_DEFLATELEVELCompression Level System Property.
-
Constructor Summary
Constructors Modifier Constructor Description protectedFilter()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract DecodeResultdecode(InputStream encoded, OutputStream decoded, COSDictionary parameters, int index)Decodes data, producing the original non-encoded data.DecodeResultdecode(InputStream encoded, OutputStream decoded, COSDictionary parameters, int index, DecodeOptions options)Decodes data, with optional DecodeOptions.protected abstract voidencode(InputStream input, OutputStream encoded, COSDictionary parameters)voidencode(InputStream input, OutputStream encoded, COSDictionary parameters, int index)Encodes data.static intgetCompressionLevel()protected COSDictionarygetDecodeParams(COSDictionary dictionary, int index)
-
-
-
Field Detail
-
SYSPROP_DEFLATELEVEL
public static final String SYSPROP_DEFLATELEVEL
Compression Level System Property. Set this to a value from 0 to 9 to change the zlib deflate compression level used to compress /Flate streams. The default value is -1 which isDeflater.DEFAULT_COMPRESSION. To set maximum compression, useSystem.setProperty(Filter.SYSPROP_DEFLATELEVEL, "9");- See Also:
- Constant Field Values
-
-
Method Detail
-
decode
public abstract DecodeResult decode(InputStream encoded, OutputStream decoded, COSDictionary parameters, int index) throws IOException
Decodes data, producing the original non-encoded data.- Parameters:
encoded- the encoded byte streamdecoded- the stream where decoded data will be writtenparameters- the parameters used for decodingindex- the index to the filter being decoded- Returns:
- repaired parameters dictionary, or the original parameters dictionary
- Throws:
IOException- if the stream cannot be decoded
-
decode
public DecodeResult decode(InputStream encoded, OutputStream decoded, COSDictionary parameters, int index, DecodeOptions options) throws IOException
Decodes data, with optional DecodeOptions. Not all filters support all options, and so callers should check the options'honoredflag to test if they were applied.- Parameters:
encoded- the encoded byte streamdecoded- the stream where decoded data will be writtenparameters- the parameters used for decodingindex- the index to the filter being decodedoptions- additional options for decoding- Returns:
- repaired parameters dictionary, or the original parameters dictionary
- Throws:
IOException- if the stream cannot be decoded
-
encode
public final void encode(InputStream input, OutputStream encoded, COSDictionary parameters, int index) throws IOException
Encodes data.- Parameters:
input- the byte stream to encodeencoded- the stream where encoded data will be writtenparameters- the parameters used for encodingindex- the index to the filter being encoded- Throws:
IOException- if the stream cannot be encoded
-
encode
protected abstract void encode(InputStream input, OutputStream encoded, COSDictionary parameters) throws IOException
- Throws:
IOException
-
getDecodeParams
protected COSDictionary getDecodeParams(COSDictionary dictionary, int index)
-
getCompressionLevel
public static int getCompressionLevel()
- Returns:
- the ZIP compression level configured for PDFBox
-
-