class PDF::Extract::Annotation

Attributes

data[R]

Public Class Methods

new(data) click to toggle source
# File lib/pdf/extract/annotation.rb, line 7
def initialize(data)
  @data = data || {}
end

Public Instance Methods

as_json() click to toggle source
# File lib/pdf/extract/annotation.rb, line 33
def as_json
  {
    "name" => name,
    "contents" => contents,
    "subtype" => subtype,
  }
end
contents() click to toggle source

PDF Reference 6th Edition, Version 1.7, November 2006 page 606 Text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation’s contents in human-readable form. In either case, this text is useful when extracting the document’s contents in support of accessibility to users with disabilities or for other purposes (see Section 10.8.2, “Alternate Descriptions”). See Section 8.4.5, “Annotation Types” for more details on the meaning of this entry for each annotation type.

# File lib/pdf/extract/annotation.rb, line 25
def contents
  data[:Contents]
end
name() click to toggle source

PDF Reference 6th Edition, Version 1.7, November 2006 page 606 The annotation name, a text string uniquely identifying it among all the annotations on its page.

# File lib/pdf/extract/annotation.rb, line 14
def name
  data[:NM]
end
subtype() click to toggle source
# File lib/pdf/extract/annotation.rb, line 29
def subtype
  data[:Subtype]
end