class HexaPDF::Type::Annotations::PolygonPolyline

Parent
Included Modules

This is the base class for the polygon and polyline markup annotations which display either a closed polygon or a polyline inside the annotation rectangle.

The styling is done through methods included by various modules:

  • Changing the line width, line dash pattern and color is done using the method BorderStyling#border_style. While that method allows special styling of the line (like :beveled), only a simple line dash pattern is supported.

  • The border effect can be changed through BorderEffect#border_effect. Note that cloudy borders are not supported.

  • The interior color can be changed through InteriorColor#interior_color.

  • The line ending style can be changed through LineEndingStyling#line_ending_style.

See: PDF2.0 s12.5.6.9, HexaPDF::Type::Annotations::Polyline, HexaPDF::Type::Annotations::Polygon, HexaPDF::Type::MarkupAnnotation

Field Definitions

NameType/Allowed ValuesRequiredDefault Value
TypeSymbolfalse:Annot
SubtypeSymboltruenil
RectHexaPDF::Rectangle or Arraytruenil
ContentsStringfalsenil
PHexaPDF::Dictionary or Hashfalsenil
NMStringfalsenil
MHexaPDF::DictionaryFields::PDFDate or String or Time or Date or DateTimefalsenil
FIntegerfalse0
APHexaPDF::Type::Annotation::AppearanceDictionary or Hashfalsenil
ASSymbolfalsenil
BorderHexaPDF::PDFArray or Arrayfalse[0, 0, 1]
CHexaPDF::PDFArray or Arrayfalsenil
StructParentIntegerfalsenil
OCHexaPDF::Dictionary or Hashfalsenil
AFHexaPDF::PDFArray or Arrayfalsenil
caNumericfalse1.0
CANumericfalse1.0
BMSymbolfalsenil
LangStringfalsenil
TStringfalsenil
PopupHexaPDF::Type::Annotation or Hashfalsenil
RCHexaPDF::Stream or String or Hashfalsenil
CreationDateHexaPDF::DictionaryFields::PDFDate or String or Time or Date or DateTimefalsenil
IRTHexaPDF::Dictionary or Hashfalsenil
SubjStringfalsenil
RTSymbol
One of: :R, :Group
false:R
ITSymbolfalsenil
ExDataHexaPDF::Type::Annotations::MarkupAnnotation::ExData or Hashfalsenil
VerticesHexaPDF::PDFArray or Arraytruenil
LEHexaPDF::PDFArray or Arrayfalse[:None, :None]
BSHexaPDF::Type::Annotation::Border or Hashfalsenil
ICHexaPDF::PDFArray or Arrayfalsenil
BEHexaPDF::Type::Annotation::BorderEffect or Hashfalsenil
ITSymbol
One of: :PolygonCloud, :PolyLineDimension, :PolygonDimension
falsenil
MeasureHexaPDF::Type::Measure or Hashfalsenil
PathHexaPDF::PDFArray or Arrayfalsenil

Public Instance Methods

vertices → [x0, y0, x1, y1, ...]
vertices(*points) → annot

Returns the array with the vertices, alternating between horizontal and vertical coordinates, when no argument is given. Otherwise sets the vertices and returns self.

This is the only required setting. Note, however, that without setting the appearance style through convenience methods like border_style nothing will be shown.

Example:

doc.annotations.
  create_polyline(doc.pages[0], 20, 20, 30, 70, 80, 60, 40, 30).
  regenerate_appearance