Method: PDF::Reader::Parser#object

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

#object(id, gen) ⇒ Object

Reads an entire PDF object from the buffer and returns it as a Ruby String. If the object is a content stream, returns both the stream and the dictionary that describes it

id - the object ID to return gen - the object revision number to return



97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/pdf/reader/parser.rb', line 97

def object(id, gen)
  Error.assert_equal(parse_token, id)
  Error.assert_equal(parse_token, gen)
  Error.str_assert(parse_token, "obj")

  obj = parse_token
  post_obj = parse_token

  if post_obj == "stream"
    stream(obj)
  else
    obj
  end
end