Method: PDF::Reader::Filter.with
- Defined in:
- lib/pdf/reader/filter.rb
.with(name, options = {}) ⇒ Object
creates a new filter for decoding content.
Filters that are only used to encode image data are accepted, but the data is returned untouched. At this stage PDF::Reader has no need to decode images.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/pdf/reader/filter.rb', line 42 def self.with(name, = {}) case name.to_sym when :ASCII85Decode then PDF::Reader::Filter::Ascii85.new() when :ASCIIHexDecode then PDF::Reader::Filter::AsciiHex.new() when :CCITTFaxDecode then PDF::Reader::Filter::Null.new() when :DCTDecode then PDF::Reader::Filter::Null.new() when :FlateDecode then PDF::Reader::Filter::Flate.new() when :JBIG2Decode then PDF::Reader::Filter::Null.new() when :JPXDecode then PDF::Reader::Filter::Null.new() when :LZWDecode then PDF::Reader::Filter::Lzw.new() when :RunLengthDecode then PDF::Reader::Filter::RunLength.new() else raise UnsupportedFeatureError, "Unknown filter: #{name}" end end |