Class FilterStream
- java.lang.Object
-
- com.adobe.internal.pdftoolkit.core.filter.FilterStream
-
public class FilterStream extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description FilterStream()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.io.InputStream
applyFilter(java.io.InputStream srcStm, ASName curFilter, FilterParams params)
Apply a named input filter to the stream.static java.io.InputStream
applyFilter(java.io.InputStream inStm, ASName filterName, FilterParams params, CustomFilterRegistry filterRegistry)
Apply a named input filter to the stream.A PDFCosParseException is thrown for filter names that are not supported or incorrect.static java.io.OutputStream
applyFilter(java.io.OutputStream inStm, ASName filterName, FilterParams params)
Apply a named output filter to the stream.static java.io.OutputStream
applyFilter(java.io.OutputStream inStm, ASName filterName, FilterParams params, CustomFilterRegistry filterRegistry)
Apply a named output filter to the stream.static FilterParams
buildFilterParams(CosObject parmsObj)
Build a suitable FilterParams class from the contents of the DecodeParms field of CosStream.static FilterParams
buildFilterParams(ASObject parmsObj)
Build a suitable FilterParams class from the contents of the DecodeParms field of an inline image's image dict.static CosObject
updateCustomFilterParams(ASName filterName, CosObject params, CustomFilterRegistry filterRegistry)
Checks if the filter is a custom encode filter and then updates the filterParams based on functionality available to the custom encode filterstatic ASDictionary
updateCustomFilterParams(ASName filterName, ASDictionary params, CustomFilterRegistry filterRegistry)
Checks if the filter is a custom encode filter and then updates the filterParams based on functionality available to the custom encode filter
-
-
-
Method Detail
-
buildFilterParams
public static FilterParams buildFilterParams(CosObject parmsObj) throws PDFCosParseException, PDFIOException, PDFSecurityException
Build a suitable FilterParams class from the contents of the DecodeParms field of CosStream. The collection of all parameters from the dictionary or array of dictionaries is merged into the FilterParams object.- Parameters:
parmsObj
-- Throws:
PDFCosParseException
PDFIOException
PDFSecurityException
-
buildFilterParams
public static FilterParams buildFilterParams(ASObject parmsObj) throws PDFInvalidParameterException
Build a suitable FilterParams class from the contents of the DecodeParms field of an inline image's image dict. The collection of all parameters from the dictionary or array of dictionaries is merged into the FilterParams object.- Parameters:
parmsObj
-- Throws:
PDFInvalidParameterException
-
applyFilter
public static java.io.InputStream applyFilter(java.io.InputStream inStm, ASName filterName, FilterParams params, CustomFilterRegistry filterRegistry) throws PDFCosParseException, java.io.IOException
Apply a named input filter to the stream.A PDFCosParseException is thrown for filter names that are not supported or incorrect. To support valid filters, the user can register their filter encoders/decoders with the PDFFilterRegistry as a document open option and they will be used or the client can extract the stream content directly.- Parameters:
inStm
-filterName
-params
-filterRegistry
-- Returns:
- decoded bytes in an inputStream
- Throws:
PDFCosParseException
java.io.IOException
-
applyFilter
public static java.io.OutputStream applyFilter(java.io.OutputStream inStm, ASName filterName, FilterParams params, CustomFilterRegistry filterRegistry) throws PDFCosParseException
Apply a named output filter to the stream.- Throws:
PDFCosParseException
- if we get a junk filter name. There are valid filters (like DCTDecode for images) that we really don't support, but there's no way to get here with those unless the client tries to extract the stream content directly.
-
applyFilter
public static java.io.InputStream applyFilter(java.io.InputStream srcStm, ASName curFilter, FilterParams params) throws PDFCosParseException, java.io.IOException
Apply a named input filter to the stream.- Throws:
PDFCosParseException
- if we get a junk filter name. There are valid filters that we really don't support, but there's no way to get here with those unless the client tries to extract the stream content directly.java.io.IOException
-
applyFilter
public static java.io.OutputStream applyFilter(java.io.OutputStream inStm, ASName filterName, FilterParams params) throws PDFCosParseException
Apply a named output filter to the stream.- Throws:
PDFCosParseException
- if we get a junk filter name. There are valid filters (like DCTDecode for images) that we really don't support, but there's no way to get here with those unless the client tries to extract the stream content directly.
-
updateCustomFilterParams
public static CosObject updateCustomFilterParams(ASName filterName, CosObject params, CustomFilterRegistry filterRegistry) throws PDFCosParseException, PDFIOException, PDFSecurityException
Checks if the filter is a custom encode filter and then updates the filterParams based on functionality available to the custom encode filter- Parameters:
filterName
-params
-filterRegistry
-- Returns:
- a CosObject representing an new updated filterParam
- Throws:
PDFCosParseException
PDFIOException
PDFSecurityException
-
updateCustomFilterParams
public static ASDictionary updateCustomFilterParams(ASName filterName, ASDictionary params, CustomFilterRegistry filterRegistry) throws PDFInvalidParameterException
Checks if the filter is a custom encode filter and then updates the filterParams based on functionality available to the custom encode filter- Parameters:
filterName
-params
-filterRegistry
-- Returns:
- an ASDictionary representing an new updated filterParam
- Throws:
PDFInvalidParameterException
-
-