annotator

package
v2.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2018 License: AGPL-3.0 Imports: 4 Imported by: 0

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

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 CircleAnnotationDef 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).
}

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL