Documentation
¶
Overview ¶
The annotator package contains an annotator with a convenient interface for creating annotations with appearance streams. It goes beyond the models package which includes definitions of basic annotation models, in that it can create the appearance streams which specify the exact appearance as needed by many pdf viewers for consistent appearance of the annotations.
Index ¶
- func CreateCircleAnnotation(circDef CircleAnnotationDef) (*pdf.PdfAnnotation, error)
- func CreateLineAnnotation(lineDef LineAnnotationDef) (*pdf.PdfAnnotation, error)
- func CreateRectangleAnnotation(rectDef RectangleAnnotationDef) (*pdf.PdfAnnotation, error)
- type CircleAnnotationDef
- type LineAnnotationDef
- type RectangleAnnotationDef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCircleAnnotation ¶
func CreateCircleAnnotation(circDef CircleAnnotationDef) (*pdf.PdfAnnotation, error)
Creates a circle/ellipse annotation object with appearance stream that can be added to page PDF annotations.
func CreateLineAnnotation ¶
func CreateLineAnnotation(lineDef LineAnnotationDef) (*pdf.PdfAnnotation, error)
Creates a line annotation object that can be added to page PDF annotations.
func CreateRectangleAnnotation ¶
func CreateRectangleAnnotation(rectDef RectangleAnnotationDef) (*pdf.PdfAnnotation, error)
Creates a rectangle annotation object that can be added to page PDF annotations.
Types ¶
type CircleAnnotationDef ¶
type LineAnnotationDef ¶
type LineAnnotationDef struct { X1 float64 Y1 float64 X2 float64 Y2 float64 LineColor *pdf.PdfColorDeviceRGB Opacity float64 // Alpha value (0-1). LineWidth float64 LineEndingStyle1 draw.LineEndingStyle // Line ending style of point 1. LineEndingStyle2 draw.LineEndingStyle // Line ending style of point 2. }
Defines a line between point 1 (X1,Y1) and point 2 (X2,Y2). The line ending styles can be none (regular line), or arrows at either end. The line also has a specified width, color and opacity.
type RectangleAnnotationDef ¶
type RectangleAnnotationDef struct { X float64 Y float64 Width float64 Height float64 FillEnabled bool // Show fill? FillColor *pdf.PdfColorDeviceRGB BorderEnabled bool // Show border? BorderWidth float64 BorderColor *pdf.PdfColorDeviceRGB Opacity float64 // Alpha value (0-1). }
A rectangle defined with a specified Width and Height and a lower left corner at (X,Y). The rectangle can optionally have a border and a filling color. The Width/Height includes the border (if any specified).