Class FilterStream
java.lang.Object
com.adobe.internal.pdftoolkit.core.filter.FilterStream
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InputStreamapplyFilter(InputStream srcStm, ASName curFilter, FilterParams params) Apply a named input filter to the stream.static InputStreamapplyFilter(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 OutputStreamapplyFilter(OutputStream inStm, ASName filterName, FilterParams params) Apply a named output filter to the stream.static OutputStreamapplyFilter(OutputStream inStm, ASName filterName, FilterParams params, CustomFilterRegistry filterRegistry) Apply a named output filter to the stream.static FilterParamsbuildFilterParams(CosObject parmsObj) Build a suitable FilterParams class from the contents of the DecodeParms field of CosStream.static FilterParamsbuildFilterParams(ASObject parmsObj) Build a suitable FilterParams class from the contents of the DecodeParms field of an inline image's image dict.static CosObjectupdateCustomFilterParams(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 ASDictionaryupdateCustomFilterParams(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
-
Constructor Details
-
FilterStream
public FilterStream()
-
-
Method Details
-
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:
PDFCosParseExceptionPDFIOExceptionPDFSecurityException
-
buildFilterParams
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 InputStream applyFilter(InputStream inStm, ASName filterName, FilterParams params, CustomFilterRegistry filterRegistry) throws PDFCosParseException, 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:
PDFCosParseExceptionIOException
-
applyFilter
public static OutputStream applyFilter(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 InputStream applyFilter(InputStream srcStm, ASName curFilter, FilterParams params) throws PDFCosParseException, 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.IOException
-
applyFilter
public static OutputStream applyFilter(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:
PDFCosParseExceptionPDFIOExceptionPDFSecurityException
-
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
-