Method: PDF::Reader::Stream#unfiltered_data

Defined in:
lib/pdf/reader/stream.rb

#unfiltered_dataObject

apply this streams filters to its data and return the result.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/pdf/reader/stream.rb', line 49

def unfiltered_data
  return @udata if @udata
  @udata = data.dup

  if hash.has_key?(:Filter)
    options = []

    if hash.has_key?(:DecodeParms)
      if hash[:DecodeParms].is_a?(Hash)
        options = [hash[:DecodeParms]]
      else
        options = hash[:DecodeParms]
      end
    end

    Array(hash[:Filter]).each_with_index do |filter, index|
      @udata = Filter.with(filter, options[index] || {}).filter(@udata)
    end
  end
  @udata
end