Пример #1
1
        /// <summary>
        /// Gets the filter specified by the case sensitive name.
        /// </summary>
        public static Filter GetFilter(string filterName)
        {
            if (filterName.StartsWith("/"))
            {
                filterName = filterName.Substring(1);
            }

            // Some tools use abbreviations
            switch (filterName)
            {
            case "ASCIIHexDecode":
            case "AHx":
                return(_asciiHexDecode ?? (_asciiHexDecode = new AsciiHexDecode()));

            case "ASCII85Decode":
            case "A85":
                return(_ascii85Decode ?? (_ascii85Decode = new Ascii85Decode()));

            case "LZWDecode":
            case "LZW":
                return(_lzwDecode ?? (_lzwDecode = new LzwDecode()));

            case "FlateDecode":
            case "Fl":
                return(_flateDecode ?? (_flateDecode = new FlateDecode()));

            //case "RunLengthDecode":
            //  if (RunLengthDecode == null)
            //    RunLengthDecode = new RunLengthDecode();
            //  return RunLengthDecode;
            //
            //case "CCITTFaxDecode":
            //  if (CCITTFaxDecode == null)
            //    CCITTFaxDecode = new CCITTFaxDecode();
            //  return CCITTFaxDecode;
            //
            //case "JBIG2Decode":
            //  if (JBIG2Decode == null)
            //    JBIG2Decode = new JBIG2Decode();
            //  return JBIG2Decode;
            //
            //case "DCTDecode":
            //  if (DCTDecode == null)
            //    DCTDecode = new DCTDecode();
            //  return DCTDecode;
            //
            //case "JPXDecode":
            //  if (JPXDecode == null)
            //    JPXDecode = new JPXDecode();
            //  return JPXDecode;
            //
            //case "Crypt":
            //  if (Crypt == null)
            //    Crypt = new Crypt();
            //  return Crypt;

            case "RunLengthDecode":
            case "CCITTFaxDecode":
            case "JBIG2Decode":
            case "DCTDecode":
            case "JPXDecode":
            case "Crypt":
                Debug.WriteLine("Filter not implemented: " + filterName);
                return(null);
            }
            throw new NotImplementedException("Unknown filter: " + filterName);
        }
Пример #2
0
        /// <summary>
        /// Gets the filter specified by the case sensitive name.
        /// </summary>
        public static Filter GetFilter(string filterName)
        {
            if (filterName.StartsWith("/"))
                filterName = filterName.Substring(1);

            // Some tools use abbreviations
            switch (filterName)
            {
                case "ASCIIHexDecode":
                case "AHx":
                    return _asciiHexDecode ?? (_asciiHexDecode = new AsciiHexDecode());

                case "ASCII85Decode":
                case "A85":
                    return _ascii85Decode ?? (_ascii85Decode = new Ascii85Decode());

                case "LZWDecode":
                case "LZW":
                    return _lzwDecode ?? (_lzwDecode = new LzwDecode());

                case "FlateDecode":
                case "Fl":
                    return _flateDecode ?? (_flateDecode = new FlateDecode());

                //case "RunLengthDecode":
                //  if (RunLengthDecode == null)
                //    RunLengthDecode = new RunLengthDecode();
                //  return RunLengthDecode;
                //
                //case "CCITTFaxDecode":
                //  if (CCITTFaxDecode == null)
                //    CCITTFaxDecode = new CCITTFaxDecode();
                //  return CCITTFaxDecode;
                //
                //case "JBIG2Decode":
                //  if (JBIG2Decode == null)
                //    JBIG2Decode = new JBIG2Decode();
                //  return JBIG2Decode;
                //
                //case "DCTDecode":
                //  if (DCTDecode == null)
                //    DCTDecode = new DCTDecode();
                //  return DCTDecode;
                //
                //case "JPXDecode":
                //  if (JPXDecode == null)
                //    JPXDecode = new JPXDecode();
                //  return JPXDecode;
                //
                //case "Crypt":
                //  if (Crypt == null)
                //    Crypt = new Crypt();
                //  return Crypt;

                case "RunLengthDecode":
                case "CCITTFaxDecode":
                case "JBIG2Decode":
                case "DCTDecode":
                case "JPXDecode":
                case "Crypt":
                    Debug.WriteLine("Filter not implemented: " + filterName);
                    return null;
            }
            throw new NotImplementedException("Unknown filter: " + filterName);
        }