Class FilterStream


  • public class FilterStream
    extends java.lang.Object
    • Constructor Detail

      • FilterStream

        public FilterStream()
    • Method Detail

      • 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.