org.apache.fop.pdf
Class PDFFilterList
java.lang.Object
org.apache.fop.pdf.PDFFilterList
public class PDFFilterList
extends java.lang.Object
This class represents a list of PDF filters to be applied when serializing
the output of a PDF object.
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.
|
void | addDefaultFilters(Map filters, String type) - Adds the default filters to this stream.
|
void | addFilter(String filterType) - Add a filter for compression of the stream by name.
|
void | addFilter(PDFFilter filter) - Add a filter for compression of the stream.
|
OutputStream | applyFilters(OutputStream stream) - Applies all registered filters as necessary.
|
protected 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.
|
CONTENT_FILTER
public static final String CONTENT_FILTER
Key for the filter used for normal content
DEFAULT_FILTER
public static final String DEFAULT_FILTER
Key for the default filter
FONT_FILTER
public static final String FONT_FILTER
Key for the filter used for fonts
IMAGE_FILTER
public static final String IMAGE_FILTER
Key for the filter used for images
JPEG_FILTER
public static final String JPEG_FILTER
Key for the filter used for JPEG images
METADATA_FILTER
public static final String METADATA_FILTER
Key for the filter used for metadata
PRECOMPRESSED_FILTER
public static final String PRECOMPRESSED_FILTER
Key for the filter used for precompressed content
TIFF_FILTER
public static final String TIFF_FILTER
Key for the filter used for TIFF images
PDFFilterList
public PDFFilterList()
Default constructor.
The flag for ignoring ASCII filters defaults to false.
PDFFilterList
public 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.
ignoreASCIIFilters
- true if ASCII filters should be ignored
addDefaultFilters
public void addDefaultFilters(Map filters,
String type)
Adds the default filters to this stream.
filters
- Map of filterstype
- which filter list to modify
addFilter
public void addFilter(String filterType)
Add a filter for compression of the stream by name.
filterType
- name of the filter to add
addFilter
public void addFilter(PDFFilter filter)
Add a filter for compression of the stream. Filters are
applied in the order they are added. This should always be a
new instance of the particular filter of choice. The applied
flag in the filter is marked true after it has been applied to the
data.
applyFilters
public OutputStream applyFilters(OutputStream stream)
throws IOException
Applies all registered filters as necessary. The method returns an
OutputStream which will receive the filtered contents.
stream
- raw data output stream
- OutputStream filtered output stream
buildFilterDictEntries
protected String buildFilterDictEntries()
Apply the filters to the data
in the order given and return the /Filter and /DecodeParms
entries for the stream dictionary. If the filters have already
been applied to the data (either externally, or internally)
then the dictionary entries are built and returned.
- a String representing the filter list
ensureFilterInPlace
public void ensureFilterInPlace(PDFFilter pdfFilter)
Checks the filter list for the filter and adds it in the correct
place if necessary.
pdfFilter
- the filter to check / add
isDisableAllFilters
public boolean isDisableAllFilters()
Returns true if all filters are disabled.
- true if all filters are disabled
isInitialized
public boolean isInitialized()
Indicates whether the filter list is already initialized.
- true if more there are filters present
putFilterDictEntries
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. If the filters have already
been applied to the data (either externally, or internally)
then the dictionary entries added.
dict
- the PDFDictionary to set the entries on
setDisableAllFilters
public void setDisableAllFilters(boolean value)
Used to disable all filters.
value
- true if all filters shall be disabled
Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.