Method: Origami::PDF#<<

Defined in:
lib/origami/pdf.rb

#<<(object) ⇒ Object Also known as: insert

Adds a new object to the PDF file. If this object has no version number, then a new one will be automatically computed and assignated to him.

It returns a Reference to this Object.

object

The object to add.



391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/origami/pdf.rb', line 391

def <<(object)
    owner = object.document

    #
    # Does object belongs to another PDF ?
    #
    if owner and not owner.equal?(self)
        import object
    else
        add_to_revision(object, @revisions.last)
    end
end