class HexaPDF::Type::Annotations::AppearanceGenerator

Parent

The AppearanceGenerator class provides methods for generating the appearance streams of annotations except those for widgets (see HexaPDF::Type::AcroForm::AppearanceGenerator for those).

There is one private create_TYPE_appearance method for each annotation type. This allows subclassing the appearance generator and adjusting the appearances to one’s needs.

By default, an existing appearance is overwritten and the :print flag is set as well as the :hidden flag unset on the annotation so that the appearance will appear on print-outs.

Also note that the annotation’s /Rect entry is modified so that it contains the whole generated appearance.

The visual appearances are chosen to be similar to those used by Adobe Acrobat and others. By subclassing and overriding the necessary methods it is possible to define custom appearances.

The default annotation appearance generator for a document can be changed using the ‘annotation.appearance_generator’ configuration option.

See: PDF2.0 s12.5

Public Class Methods

new(annotation)

Creates a new instance for the given annotation.

Public Instance Methods

create_appearance()

Creates the appropriate appearance for the annotation provided on initialization.