class HexaPDF::Type::Annotation

Extended With

Annotations are used to associate objects like notes, sounds or movies with a location on a PDF page or allow the user to interact with a PDF document using a keyboard or mouse.

See: PDF2.0 s12.5

Field Definitions

NameType/Allowed ValuesRequiredDefault Value
RectHexaPDF::Rectangle or Arraytruenil
PHexaPDF::Dictionary or Hashfalsenil
MHexaPDF::DictionaryFields::PDFDate or String or Time or Date or DateTimefalsenil
APHexaPDF::Type::Annotation::AppearanceDictionary or Hashfalsenil
BorderHexaPDF::PDFArray or Arrayfalse[0, 0, 1]
CHexaPDF::PDFArray or Arrayfalsenil
OCHexaPDF::Dictionary or Hashfalsenil

Public Instance Methods

appearance(type: :normal, state_name: self[:AS])

Returns the annotation's appearance stream of the given type (:normal, :rollover, or :down) or nil if it doesn't exist.

The appearance state in /AS or the one provided via state_name is taken into account if necessary.

Also aliased as: appearance?
appearance?(type: :normal, state_name: self[:AS])
Alias for: appearance

Returns the AppearanceDictionary instance associated with the annotation or nil if none is set.

create_appearance(type: :normal, state_name: self[:AS])

Creates an empty appearance stream (a Form XObject) of the given type (:normal, :rollover, or :down) and returns it. If an appearance stream already exist, it is overwritten.

If there can be multiple appearance streams for the annotation, use the state_name argument to provide the appearance state name.


Returns true because annotation objects must always be indirect objects.