class

PDF::Objects::Indirect

Inherits PDF::Objects::Base < Reference < Object

Represents a PDF indirect object.

An indirect object is a labeled object that can be referenced from elsewhere in the PDF. It consists of:

  • Object number (positive integer)
  • Generation number (non-negative integer)
  • The object value
dict = PDF::Objects::Dictionary.new
dict["Type"] = PDF::Objects::Name::PAGE

obj = PDF::Objects::Indirect.new(5, 0, dict)
obj.to_pdf
# => "5 0 obj\n<</Type /Page>>\nendobj"

obj.reference.to_pdf
# => "5 0 R"

Constructors

new(object_number : Int32, generation : Int32, value : Base)
Source
new(object_number : Int32, value : Base)

Creates an indirect object with generation 0

Source

Instance methods

==(other : self)

Returns true if this reference is the same as other. Invokes same?.

generation
Source
hash(hasher)

See Object#hash(hasher)

object_number
Source
ref

Alias for reference

Source
reference

Returns a Reference to this indirect object

Source
to_pdf(io : IO) : Nil

Serializes this object to an IO.

By default, this writes the result of #to_pdf to the IO. Subclasses may override for more efficient streaming.

Source
to_pdf

Serializes this object to PDF syntax.

Returns the PDF representation as a string.

Source
value
Source