class PdfLinksChecker::Page
Attributes
annotations[R]
pdf_page[R]
Public Class Methods
new(pdf_page, annotations)
click to toggle source
# File lib/pdf_links_checker/page.rb, line 3 def initialize(pdf_page, annotations) @pdf_page = pdf_page @annotations = annotations end
Public Instance Methods
links()
click to toggle source
# File lib/pdf_links_checker/page.rb, line 8 def links find_links end
Private Instance Methods
find_links()
click to toggle source
# File lib/pdf_links_checker/page.rb, line 14 def find_links references = (pdf_page.attributes[:Annots] || []) annotations.find(references).flatten.select{ |object| link?(object) } end
link?(object)
click to toggle source
# File lib/pdf_links_checker/page.rb, line 19 def link?(object) object[:Type] == :Annot && [:Link].include?(object[:Subtype]) end