document

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

The document package provides the functionality to export reports and documents as PDF.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doc

type Doc struct {
	Pdf gopdf.GoPdf
	// contains filtered or unexported fields
}

Doc is the basic structure for a PDF file.

func NewDoc

func NewDoc(fontSize int, lineSpread float64) Doc

NewDoc returns a new Doc.

func (*Doc) AddFormattedMultilineText

func (d *Doc) AddFormattedMultilineText(x, y float64, content string, size int, style string)

AddFormattedMultilineText has the same functionality as AddMultilineText but with a individual font-size and style.

func (*Doc) AddFormattedText

func (d *Doc) AddFormattedText(x, y float64, content string, size int, style string)

AddFormattedText adds a text field at the given position with individual size and style.

func (*Doc) AddMultilineText

func (d *Doc) AddMultilineText(x, y float64, content string)

AddMultilineText adds a text field with multiple lines of text. The lines are divided by the new-line character `\n`.

func (*Doc) AddText

func (d *Doc) AddText(x, y float64, content string)

AddText adds a text field at the given position.

func (*Doc) DefaultFontSize

func (d *Doc) DefaultFontSize()

DefaultFontSize resets the font size to the initial default.

func (*Doc) DefaultFontStyle

func (d *Doc) DefaultFontStyle()

DefaultFontStyle resets the font style to normal style.

func (Doc) LineHeight

func (d Doc) LineHeight() float64

LineHeight calculates and returns the line height.

func (*Doc) SetFontSize

func (d *Doc) SetFontSize(size int)

SetFontSize sets the font size for all elements added after.

func (*Doc) SetFontStyle

func (d *Doc) SetFontStyle(style string)

SetFontStyle changes the font style (italic, bold...) for elements added afterwards.

func (*Doc) SetPosition

func (d *Doc) SetPosition(x, y float64)

SetPosition encapsulates the SetX and SetY methods of gopdf. New elements will be added at the currently set position.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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