| Class | Origami::ObjectStream |
| In: |
sources/parser/stream.rb
|
| Parent: | Stream |
Class representing a Stream containing other Objects.
TODO Adds a new Object to this Stream.
| object: | The Object to append. |
# File sources/parser/stream.rb, line 396
396: def <<(object)
397:
398: unless object.generation == 0
399: raise InvalidObject, "Cannot store an object with generation > 0 in an ObjectStream"
400: end
401:
402: if object.is_a?(Stream)
403: raise InvalidObject, "Cannot store a Stream in an ObjectStream"
404: end
405:
406: load! if @objects.nil?
407:
408: object.no, object.generation = @pdf.alloc_new_object_number if object.no == 0
409:
410: object.set_indirect(true) # object is indirect
411: object.parent = self # set this stream as the parent
412: object.set_pdf(@pdf) # indirect objects need pdf information
413: @objects[object.no] = object
414:
415: Reference.new(object.no, 0)
416: end