class PdfLinksChecker::Annotations

Attributes

objects[R]

Public Class Methods

new(pdf_doc) click to toggle source
# File lib/pdf_links_checker/annotations.rb, line 3
def initialize(pdf_doc)
  @objects = pdf_doc.objects
end

Public Instance Methods

find(references) click to toggle source
# File lib/pdf_links_checker/annotations.rb, line 7
def find(references)
  lookup_all(references)
end
lookup(ref) click to toggle source
# File lib/pdf_links_checker/annotations.rb, line 16
def lookup(ref)
  object = objects[ref]
  return object unless object.is_a?(Array)

  lookup_all(object)
end
lookup_all(refs) click to toggle source
# File lib/pdf_links_checker/annotations.rb, line 11
def lookup_all(refs)
  refs = *refs
  refs.map { |ref| lookup(ref) }
end