lib/prawn/core/object_store.rb
def load_object_graph(hash, object)
        @loaded_objects ||= {}
        case object
        when ::Hash then
          object.each { |key,value| object[key] = load_object_graph(hash, value) }
          object
        when Array then
          object.map { |item| load_object_graph(hash, item)}
        when PDF::Reader::Reference then
          unless @loaded_objects.has_key?(object.id)
            @loaded_objects[object.id] = ref(nil)
            new_obj = load_object_graph(hash, hash[object])
          if new_obj.kind_of?(PDF::Reader::Stream)
            stream_dict = load_object_graph(hash, new_obj.hash)
            @loaded_objects[object.id].data = stream_dict
            @loaded_objects[object.id] << new_obj.data
            else
              @loaded_objects[object.id].data = new_obj
            end
          end
          @loaded_objects[object.id]
        when PDF::Reader::Stream
          # Stream is a subclass of string, so this is here to prevent the stream
          # being wrapped in a LiteralString
          object
        when String
          is_utf8?(object) ? object : Prawn::Core::ByteString.new(object)
        else
          object
        end
      end
# recurse down an object graph from a source PDF, importing all the
# indirect objects we find.
#
# hash is the PDF::Reader::ObjectHash to extract objects from, object is
# the object to extract.
#
recurse down an object graph from a source PDF, importing all the
indirect objects we find.

hash is the PDF::Reader::ObjectHash to extract objects from, object is
the object to extract.
recurse down an object graph from a source PDF importing all the indirect objects we find . hash is the PDF :: Reader :: ObjectHash to extract objects from object is the object to extract .
def load_object_graph(hash, object)
        @loaded_objects ||= {}
        case object
        when ::Hash then
          object.each { |key,value| object[key] = load_object_graph(hash, value) }
          object
        when Array then
          object.map { |item| load_object_graph(hash, item)}
        when PDF::Reader::Reference then
          unless @loaded_objects.has_key?(object.id)
            @loaded_objects[object.id] = ref(nil)
            new_obj = load_object_graph(hash, hash[object])
          if new_obj.kind_of?(PDF::Reader::Stream)
            stream_dict = load_object_graph(hash, new_obj.hash)
            @loaded_objects[object.id].data = stream_dict
            @loaded_objects[object.id] << new_obj.data
            else
              @loaded_objects[object.id].data = new_obj
            end
          end
          @loaded_objects[object.id]
        when PDF::Reader::Stream
          object
        when String
          is_utf8?(object) ? object : Prawn::Core::ByteString.new(object)
        else
          object
        end
      end
def load_object_graph ( hash , object ) @loaded_objects ||= { } case object when :: Hash then object . each { | key , value | object [ key ] = load_object_graph ( hash , value ) } object when Array then object . map { | item | load_object_graph ( hash , item ) } when PDF :: Reader :: Reference then unless @loaded_objects . has_key? ( object . id ) @loaded_objects [ object . id ] = ref ( nil ) new_obj = load_object_graph ( hash , hash [ object ] ) if new_obj . kind_of? ( PDF :: Reader :: Stream ) stream_dict = load_object_graph ( hash , new_obj . hash ) @loaded_objects [ object . id ] . data = stream_dict @loaded_objects [ object . id ] << new_obj . data else @loaded_objects [ object . id ] . data = new_obj end end @loaded_objects [ object . id ] when PDF :: Reader :: Stream object when String is_utf8? ( object ) ? object : Prawn :: Core :: ByteString . new ( object ) else object end end
recurse down an object graph from a source PDF, importing all the
indirect objects we find.
recurse down an object graph from a source PDF importing all the indirect objects we find .
# Stream is a subclass of string, so this is here to prevent the stream # being wrapped in a LiteralString
hash
object