vgpdf

package
v0.0.0-...-42f891b Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package vgpdf implements the vg.Canvas interface using pdfwriter. Unlike the PDF driver supplied by gonum.org/v1/plot/vg, which only supports creating a PDF with a single plot, this driver supports creating multiple plots in the PDF. These plots can either be on individual pages, or interspersed with text and other elements.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas struct {
	// contains filtered or unexported fields
}

Canvas represents a page, or a section of a page, used for drawing 2D graphics, and which supports the interface gonum.org/v1/plot/vg.Canvas. Using this type, users can create plots using gonum.org/v1/plot, and output those plots into a PDF document.

func New

func New(doc *pdf.PDF, pos pdf.Point, size pdf.Size) *Canvas

New creates a new canvas where drawing operations will occur in a specified region of the current page. The graphics state will be modified, so users will need to manage their graphics state using Push, Pop, or WithState, if they want to resume drawing after plotting.

func NewPage

func NewPage(doc *pdf.PDF, size pdf.Size) *Canvas

NewPage creates a new canvas where drawing operations will occur on a new page in the PDF document.

func (*Canvas) DrawImage

func (c *Canvas) DrawImage(rect vg.Rectangle, img image.Image)

DrawImage supports the interface gonum.org/v1/plot/vg.Canvas.

func (*Canvas) Fill

func (c *Canvas) Fill(p vg.Path)

Fill supports the interface gonum.org/v1/plot/vg.Canvas.

func (*Canvas) FillString

func (c *Canvas) FillString(fnt vg.Font, pt vg.Point, str string)

FillString supports the interface gonum.org/v1/plot/vg.Canvas.

func (*Canvas) Pop

func (c *Canvas) Pop()

Pop supports the interface gonum.org/v1/plot/vg.Canvas.

func (*Canvas) Push

func (c *Canvas) Push()

Push supports the interface gonum.org/v1/plot/vg.Canvas.

func (*Canvas) Rotate

func (c *Canvas) Rotate(r float64)

Rotate supports the interface gonum.org/v1/plot/vg.Canvas.

func (*Canvas) Scale

func (c *Canvas) Scale(x float64, y float64)

Scale supports the interface gonum.org/v1/plot/vg.Canvas.

func (*Canvas) SetColor

func (c *Canvas) SetColor(clr color.Color)

SetColor supports the interface gonum.org/v1/plot/vg.Canvas.

func (*Canvas) SetLineDash

func (c *Canvas) SetLineDash(dashes []vg.Length, offs vg.Length)

SetLineDash supports the interface gonum.org/v1/plot/vg.Canvas.

func (*Canvas) SetLineWidth

func (c *Canvas) SetLineWidth(w vg.Length)

SetLineWidth supports the interface gonum.org/v1/plot/vg.Canvas.

func (*Canvas) Size

func (c *Canvas) Size() (w, h vg.Length)

Size returns the size of the canvas. This method supports the interface gonum.org/v1/plot/vg.CanvaSizer.

func (*Canvas) Stroke

func (c *Canvas) Stroke(p vg.Path)

Stroke supports the interface gonum.org/v1/plot/vg.Canvas.

func (*Canvas) Translate

func (c *Canvas) Translate(pt vg.Point)

Translate supports the interface gonum.org/v1/plot/vg.Canvas.

Jump to

Keyboard shortcuts

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