Documentation
¶
Overview ¶
gpdf generates PDF using a %-based coordinate system, with high-level functions for page elements absolute coordinate methods
gpdf generates PDF using a %-based coordinate system, with high-level functions for page elements color processing
gpdf generates PDF using a %-based coordinate system, with high-level functions for page elements convenience functions
gpdf generates PDF using a %-based coordinate system, with high-level functions for page elements
gpdf generates PDF using a %-based coordinate system, with high-level functions for page elements percentage-based methods
Index ¶
- Constants
- func ColorLookup(s string) creator.ColorRGBA
- func MapRange(value, low1, high1, low2, high2 float64) float64
- type CF
- type Canvas
- func (c *Canvas) AbsArc(x, y, w, h, a1, a2, size float64, color creator.ColorRGBA)
- func (c *Canvas) AbsBText(x, y, size float64, s string, fillcolor creator.ColorRGBA)
- func (c *Canvas) AbsCText(x, y, size float64, s string, fillcolor creator.ColorRGBA)
- func (c *Canvas) AbsCenterImage(x, y, w, h float64, img *creator.Image) error
- func (c *Canvas) AbsCenterImageName(x, y, w, h float64, name string) error
- func (c *Canvas) AbsCenterRect(x, y, w, h float64, color creator.ColorRGBA)
- func (c *Canvas) AbsCircle(x, y, r float64, color creator.ColorRGBA)
- func (c *Canvas) AbsCornerRect(x, y, w, h float64, color creator.ColorRGBA)
- func (c *Canvas) AbsCubicBezier(bx, by, c0x, c0y, c1x, c1y, ex, ey, size float64, color creator.ColorRGBA)
- func (c *Canvas) AbsEText(x, y, size float64, s string, fillcolor creator.ColorRGBA)
- func (c *Canvas) AbsEllipse(x, y, w, h float64, color creator.ColorRGBA)
- func (c *Canvas) AbsGradRect(x, y, w, h float64, color1, color2 creator.ColorRGBA, percent float64)
- func (c *Canvas) AbsImage(x, y, w, h float64, name string) error
- func (c *Canvas) AbsLine(x0, y0, x1, y1, size float64, color creator.ColorRGBA)
- func (c *Canvas) AbsPolygon(x, y []float64, color creator.ColorRGBA)
- func (c *Canvas) AbsQuadBezier(bx, by, cx, cy, ex, ey, size float64, color creator.ColorRGBA)
- func (c *Canvas) AbsRText(x, y, size, angle float64, s string, color creator.ColorRGBA)
- func (c *Canvas) AbsText(x, y, size float64, s string, color creator.ColorRGBA)
- func (c *Canvas) Arc(x, y, w, h, a1, a2, size float64, fillcolor string, opacity ...float64)
- func (c *Canvas) BText(x, y, size float64, s string, fillcolor string, opacity ...float64)
- func (c *Canvas) Background(fillcolor string)
- func (c *Canvas) CText(x, y, size float64, s string, fillcolor string, opacity ...float64)
- func (c *Canvas) Circle(x, y, r float64, fillcolor string, opacity ...float64)
- func (c *Canvas) Coord(x, y, size float64, s string, fillcolor string)
- func (c *Canvas) CornerRect(x, y, w, h float64, fillcolor string, opacity ...float64)
- func (c *Canvas) CubicCurve(bx, by, cx1, cy1, cx2, cy2, ex, ey, size float64, strokecolor string, ...)
- func (c *Canvas) Curve(bx, by, cx, cy, ex, ey, size float64, strokecolor string, opacity ...float64)
- func (c *Canvas) EText(x, y, size float64, s string, fillcolor string, opacity ...float64)
- func (c *Canvas) Ellipse(x, y, w, h float64, fillcolor string, opacity ...float64)
- func (c *Canvas) GradRect(x, y, w, h float64, color1 string, color2 string, percent float64)
- func (c *Canvas) Grid(xmin, xmax, ymin, ymax, size, incr float64, color string)
- func (c *Canvas) Image(x, y, w, h float64, img Pimage)
- func (c *Canvas) ImageName(x, y, w, h float64, name string)
- func (c *Canvas) ImageScale(x, y, w, h, scale float64, img Pimage)
- func (c *Canvas) ImageScaleName(x, y, w, h, scale float64, name string)
- func (c *Canvas) LGrid(xmin, xmax, ymin, ymax, size, incr float64, color string, opacity ...float64)
- func (c *Canvas) Line(x0, y0, x1, y1, size float64, strokecolor string, opacity ...float64)
- func (c *Canvas) LoadFontFile(path string) (*creator.CustomFont, error)
- func (c *Canvas) LoadImage(name string) (Pimage, error)
- func (c *Canvas) NewPage(width, height float64) error
- func (c *Canvas) Polar(cx, cy, r, theta float64) (float64, float64)
- func (c *Canvas) PolarDegrees(cx, cy, r, theta float64) (float64, float64)
- func (c *Canvas) Polygon(x, y []float64, fillcolor string, opacity ...float64)
- func (c *Canvas) Polyline(x, y []float64, size float64, strokecolor string, opacity ...float64)
- func (c *Canvas) QuadCurve(bx, by, cx, cy, ex, ey, size float64, strokecolor string, opacity ...float64)
- func (c *Canvas) RText(x, y, size, angle float64, s string, fillcolor string, opacity ...float64)
- func (c *Canvas) Rect(x, y, w, h float64, fillcolor string, opacity ...float64)
- func (c *Canvas) SetAuthor(s string)
- func (c *Canvas) SetFont(f *creator.CustomFont)
- func (c *Canvas) SetTitle(s string)
- func (c *Canvas) Square(x, y, w float64, fillcolor string, opacity ...float64)
- func (c *Canvas) Text(x, y, size float64, s string, fillcolor string, opacity ...float64)
- func (c *Canvas) TextWrap(x, y, w, size, linespacing float64, s string, textcolor string, ...)
- func (c *Canvas) TextWrapStrict(x, y, w, size, linespacing float64, s string, textcolor string, ...)
- type Pimage
Constants ¶
const ( Letter = creator.Letter Legal = creator.Legal Tabloid = creator.Tabloid A3 = creator.A3 A4 = creator.A4 A5 = creator.A5 B4 = creator.B4 Mono = creator.Courier Sans = creator.Helvetica Serif = creator.TimesRoman )
built-in pagesizes and fonts
Variables ¶
This section is empty.
Functions ¶
func ColorLookup ¶
ColorLookup returns a color.RGBA corresponding to the named color or "rgb(r)", "rgb(r,b)", "rgb(r,g,b), "rgb(r,g,b,a)", "#rr", "#rrgg", "#rrggbb", "#rrggbbaa" string. "hsv(hue,sat,value)" On error, return black.
Types ¶
type CF ¶
type CF *creator.CustomFont
type Canvas ¶
type Canvas struct {
Page *creator.Page
Creator *creator.Creator
StdFont creator.FontName
CustomFont *creator.CustomFont
Width, Height float64
}
Canvas object
func SetupCanvas ¶
SetupCanvas nitializes the canvas object, with specified dimensions
func SetupCanvasStdSize ¶
SetupCanvas initializes the canvas object with a standard page size
func (*Canvas) AbsCenterImage ¶
AbsCenterImage places an image centered at (x,y),dimensions of (w,h)
func (*Canvas) AbsCenterImageName ¶
AbsCenterImageName places a named image at centered at (x,y), dimensions of (w,h)
func (*Canvas) AbsCenterRect ¶
AbsCenterRect makes a rectangle centered (x,y), width(w), height(h)
func (*Canvas) AbsCornerRect ¶
func (*Canvas) AbsCubicBezier ¶
func (c *Canvas) AbsCubicBezier(bx, by, c0x, c0y, c1x, c1y, ex, ey, size float64, color creator.ColorRGBA)
AbsCubicBezier makes a stroked cubic Bezier begin (bx, by), control points at (c0x,c0y) and (c1x, c1y) end point at (ex,ey)
func (*Canvas) AbsEllipse ¶
AbsEllipse make an ellipse centered at (x,y), width(w), height(h)
func (*Canvas) AbsGradRect ¶
AbsGradRect makes a gradient filled rectangle lower left at (x,y), width(w), height(h)
func (*Canvas) AbsPolygon ¶
AbsPolygon makes a filled polygon using coordinates in x and y
func (*Canvas) AbsQuadBezier ¶
AbsQuadBezier makes a stroked quadradic Bezier curve begin (bx, by), control (cx, cy), end (ex, ey)
func (*Canvas) Arc ¶
Arc makes a stroked arc, using percentage-based measures center is (x, y), the arc begins at angle a1, and ends at a2, with radius r. The arc is stroked with the specified stroke size and color
func (*Canvas) Background ¶
Background set the page background color
func (*Canvas) Coord ¶
Coord shows the specified coordinate, using percentage-based coordinates the (x, y) label is above the point, with a label below
func (*Canvas) CornerRect ¶
CornerRect a color filled rectangle lower left at (x,y), with dimentions (w,h)
func (*Canvas) CubicCurve ¶
func (c *Canvas) CubicCurve(bx, by, cx1, cy1, cx2, cy2, ex, ey, size float64, strokecolor string, opacity ...float64)
CubicCurve draws a quadradic bezier curve begin coordinates (bx, by) control coordinates (cx, cy) end coordinates at (ex, ey)
func (*Canvas) Curve ¶
func (c *Canvas) Curve(bx, by, cx, cy, ex, ey, size float64, strokecolor string, opacity ...float64)
Curve makes a quadradic bezier curve
func (*Canvas) Grid ¶
Grid makes a unlabeled coordinate grid starting at (xmin, ymin) ending at (xmax, ymax), line width is size, incr is the size of the grid
func (*Canvas) ImageScale ¶
func (*Canvas) ImageScaleName ¶
func (*Canvas) LGrid ¶
func (c *Canvas) LGrid(xmin, xmax, ymin, ymax, size, incr float64, color string, opacity ...float64)
Grid makes a labeled coordinate grid starting at (xmin, ymin) ending at (xmax, ymax), line width is size, incr is the size of the grid
func (*Canvas) LoadFontFile ¶
func (c *Canvas) LoadFontFile(path string) (*creator.CustomFont, error)
LoadFont loads a custom font
func (*Canvas) Polar ¶
Polar returns the Cartesian coordinates (x, y) from polar coordinates with compensation for canvas aspect ratio center at (cx, cy), radius r, and angle theta (radians)
func (*Canvas) PolarDegrees ¶
PolarDegrees returns the Cartesian coordinates (x, y) from polar coordinates with compensation for canvas aspect ratio center at (cx, cy), radius r, and angle theta (degrees)
func (*Canvas) Polygon ¶
Polygon makes a color filled polygon using the specified coordinates in x and y
func (*Canvas) QuadCurve ¶
func (c *Canvas) QuadCurve(bx, by, cx, cy, ex, ey, size float64, strokecolor string, opacity ...float64)
QuadCurve draws a quadradic bezier curve begin coordinates (bx, by) control coordinates (cx, cy) end coordinates at (ex, ey)
func (*Canvas) SetFont ¶
func (c *Canvas) SetFont(f *creator.CustomFont)
SetFont specifes the current font

