public class PDFFilterList
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTENT_FILTER
Key for the filter used for normal content
|
static java.lang.String |
DEFAULT_FILTER
Key for the default filter
|
static java.lang.String |
FONT_FILTER
Key for the filter used for fonts
|
static java.lang.String |
IMAGE_FILTER
Key for the filter used for images
|
static java.lang.String |
JPEG_FILTER
Key for the filter used for JPEG images
|
static java.lang.String |
METADATA_FILTER
Key for the filter used for metadata
|
static java.lang.String |
PRECOMPRESSED_FILTER
Key for the filter used for precompressed content
|
static java.lang.String |
TIFF_FILTER
Key for the filter used for TIFF images
|
Constructor and Description |
---|
PDFFilterList()
Default constructor.
|
PDFFilterList(boolean ignoreASCIIFilters)
Use this descriptor if you want to have ASCII filters (such as ASCIIHex
and ASCII85) ignored, for example, when encryption is active.
|
Modifier and Type | Method and Description |
---|---|
void |
addDefaultFilters(java.util.Map filters,
java.lang.String type)
Adds the default filters to this stream.
|
void |
addFilter(PDFFilter filter)
Add a filter for compression of the stream.
|
void |
addFilter(java.lang.String filterType)
Add a filter for compression of the stream by name.
|
java.io.OutputStream |
applyFilters(java.io.OutputStream stream)
Applies all registered filters as necessary.
|
protected java.lang.String |
buildFilterDictEntries()
Apply the filters to the data
in the order given and return the /Filter and /DecodeParms
entries for the stream dictionary.
|
void |
ensureFilterInPlace(PDFFilter pdfFilter)
Checks the filter list for the filter and adds it in the correct
place if necessary.
|
boolean |
isDisableAllFilters()
Returns true if all filters are disabled.
|
boolean |
isInitialized()
Indicates whether the filter list is already initialized.
|
protected void |
putFilterDictEntries(PDFDictionary dict)
Apply the filters to the data
in the order given and add the /Filter and /DecodeParms
entries to the stream dictionary.
|
void |
setDisableAllFilters(boolean value)
Used to disable all filters.
|
public static final java.lang.String DEFAULT_FILTER
public static final java.lang.String CONTENT_FILTER
public static final java.lang.String PRECOMPRESSED_FILTER
public static final java.lang.String IMAGE_FILTER
public static final java.lang.String JPEG_FILTER
public static final java.lang.String TIFF_FILTER
public static final java.lang.String FONT_FILTER
public static final java.lang.String METADATA_FILTER
public PDFFilterList()
The flag for ignoring ASCII filters defaults to false.
public PDFFilterList(boolean ignoreASCIIFilters)
ignoreASCIIFilters
- true if ASCII filters should be ignoredpublic void setDisableAllFilters(boolean value)
value
- true if all filters shall be disabledpublic boolean isDisableAllFilters()
public boolean isInitialized()
public void addFilter(PDFFilter filter)
filter
- filter to addpublic void addFilter(java.lang.String filterType)
filterType
- name of the filter to addpublic void ensureFilterInPlace(PDFFilter pdfFilter)
pdfFilter
- the filter to check / addpublic void addDefaultFilters(java.util.Map filters, java.lang.String type)
filters
- Map of filterstype
- which filter list to modifyprotected java.lang.String buildFilterDictEntries()
protected void putFilterDictEntries(PDFDictionary dict)
dict
- the PDFDictionary to set the entries onpublic java.io.OutputStream applyFilters(java.io.OutputStream stream) throws java.io.IOException
stream
- raw data output streamjava.io.IOException
- In case of an I/O problemCopyright 1999-2010 The Apache Software Foundation. All Rights Reserved.