Documentation
¶
Index ¶
- Variables
- type Options
- type PDF
- func (r *PDF) AddAnchor(name string, rect canvas.Rect)
- func (r *PDF) AddLink(uri string, rect canvas.Rect)
- func (r *PDF) AddOutline(name string, level int, y float64)
- func (r *PDF) Close() error
- func (r *PDF) NewPage(width, height float64)
- func (r *PDF) RenderImage(img image.Image, m canvas.Matrix)
- func (r *PDF) RenderPath(path *canvas.Path, style canvas.Style, m canvas.Matrix)
- func (r *PDF) RenderText(text *canvas.Text, m canvas.Matrix)
- func (r *PDF) SetImageEncoding(enc canvas.ImageEncoding)
- func (r *PDF) SetInfo(title, subject, keywords, author, creator string)
- func (r *PDF) SetLang(lang string)
- func (r *PDF) Size() (float64, float64)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type PDF ¶
type PDF struct {
// contains filtered or unexported fields
}
PDF is a portable document format renderer.
func (*PDF) AddAnchor ¶
AddAnchor adds an anchor that can be referenced by a link (see AddLink). The rectangle is the area to be referenced. If the width and height are zero and the X and Y positions are zero, it will fit the entire page. If either width/height and X/Y are zero then it will fit the page's height/width and scroll to the X/Y position. Otherwise, if the width and height are zero and X and Y are not zero, it will scroll to the position but not change it's zoom.
func (*PDF) AddLink ¶
AddLink adds a link at the given rectangle. If the URI starts with # this will link to an anchor (set with AddAnchor).
func (*PDF) AddOutline ¶
AddOutline adds an outline element at the given y position. The top-level element must have level zero. If any level is missing, then higher level elements are ignored.
func (*PDF) RenderImage ¶
RenderImage renders an image to the canvas using a transformation matrix.
func (*PDF) RenderPath ¶
RenderPath renders a path to the canvas using a style and a transformation matrix.
func (*PDF) RenderText ¶
RenderText renders a text object to the canvas using a transformation matrix.
func (*PDF) SetImageEncoding ¶
func (r *PDF) SetImageEncoding(enc canvas.ImageEncoding)
SetImageEncoding sets the image encoding to Loss or Lossless.