class HexaPDF::Task::Dereference

Task for recursively dereferencing a single object or the reachable parts of the whole PDF document. Dereferencing means that the references are replaced with the actual objects.

Running this task is most often done to prepare for other steps in a PDF transformation process.

Public Class Methods

call(doc, object: nil) click to toggle source

Recursively dereferences the reachable parts of the document and returns an array of objects that are never referenced. This includes indirect objects that are used as values for the /Length entry of a stream.

If the optional argument object is provided, only the given object is dereferenced and nothing is returned.

# File lib/hexapdf/task/dereference.rb, line 52
def self.call(doc, object: nil)
  new(doc, object).result
end