Documentation
¶
Index ¶
- func RestorePreviousFonts(s rich.SettingsData)
- func UseStandardFonts() rich.SettingsData
- type PDF
- func (r *PDF) AddAnchor(name string, pos math32.Vector2)
- func (r *PDF) AddLayer(name string, visible bool) (layerID int)
- func (r *PDF) AddLink(uri string, rect math32.Box2)
- func (r *PDF) BeginLayer(id int)
- func (r *PDF) Close() error
- func (r *PDF) Cumulative() math32.Matrix2
- func (r *PDF) EndLayer()
- func (r *PDF) FillBox(m math32.Matrix2, bb math32.Box2, clr image.Image)
- func (r *PDF) Image(img image.Image, m math32.Matrix2)
- func (r *PDF) NewPage(width, height float32)
- func (r *PDF) Path(path ppath.Path, style *styles.Paint, tr math32.Matrix2)
- func (r *PDF) PopStack()
- func (r *PDF) PushStack()
- func (r *PDF) PushTransform(m math32.Matrix2)
- func (r *PDF) SetInfo(title, subject, keywords, author, creator string)
- func (r *PDF) SetLang(lang string)
- func (r *PDF) SetTransform(m math32.Matrix2)
- func (r *PDF) Size() (float32, float32)
- func (r *PDF) Text(style *styles.Paint, m math32.Matrix2, pos math32.Vector2, lns *shaped.Lines)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RestorePreviousFonts ¶
func RestorePreviousFonts(s rich.SettingsData)
RestorePreviousFonts sets the rich.Settings default fonts to those returned from UseStandardFonts
func UseStandardFonts ¶
func UseStandardFonts() rich.SettingsData
UseStandardFonts sets the rich.Settings default fonts to the corresponding PDF defaults, so that text layout works correctly for the PDF rendering. The current settings are returned, and should be passed to RestorePreviousFonts when done.
Types ¶
type PDF ¶
type PDF struct {
// contains filtered or unexported fields
}
PDF is a portable document format renderer.
func (*PDF) AddAnchor ¶
AddAnchor adds a uniquely-named link anchor location, which can then be a target for links.
func (*PDF) AddLayer ¶
AddLayer defines a layer that can be shown or hidden when the document is displayed. name specifies the layer name that the document reader will display in the layer list. visible specifies whether the layer will be initially visible. The return value is an integer ID that is used in a call to BeginLayer().
func (*PDF) BeginLayer ¶
BeginLayer is called to begin adding content to the specified layer. All content added to the page between a call to BeginLayer and a call to EndLayer is added to the layer specified by id. See AddLayer for more details.
func (*PDF) Cumulative ¶
Cumulative returns the current cumulative transform.
func (*PDF) EndLayer ¶
func (r *PDF) EndLayer()
EndLayer is called to stop adding content to the currently active layer. See BeginLayer for more details.
func (*PDF) Path ¶
Path renders a path to the canvas using a style and an individual matrix (needed for fill)
func (*PDF) PopStack ¶
func (r *PDF) PopStack()
PopStack adds a graphics stack pop which must be paired with a corresponding Push.
func (*PDF) PushStack ¶
func (r *PDF) PushStack()
PushStack adds a graphics stack push, which must be paired with a corresponding Pop.
func (*PDF) PushTransform ¶
PushTransform adds a graphics stack push (q) and then cm to set the current matrix transform (CMT).
func (*PDF) SetLang ¶
SetLang sets the document's language. It must adhere the RFC 3066 specification on Language-Tag, eg. es-CL.
func (*PDF) SetTransform ¶
SetTransform adds a cm to set the current matrix transform (CMT).