vprinter

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DarkBlue = ColorRGB{65, 182, 255}
View Source
var DarkGreen = ColorRGB{99, 182, 99}
View Source
var LightBlue = ColorRGB{214, 239, 255}
View Source
var LightGreen = ColorRGB{219, 240, 219}

Functions

func LoadFont

func LoadFont(path string) ([]byte, error)

LoadFont will load a font file from path, verify that it is usable with the gofpdf library, and that it is a fixed-with font. If everything is okay, we will return the font as a byte array and error will be nil.

Types

type ColorRGB

type ColorRGB struct{ R, G, B int }

type Job

type Job interface {
	// AddLine adds one line of output to the print job. linefeed indicates
	// whether, in addition to a carriage return action at the end of the
	// line, the printer should advance by one line. (linefeed=false will
	// cause the next line to overtype the current line.) Returns the current
	// number of pages in the job so far.
	AddLine(text string, linefeed bool) int

	// NewPage indicates that the print job encountered a form feed character.
	// Returns the current number of pages in the job so far.
	NewPage() int

	// EndJob instructs the virtual printer to end the job and write the
	// output (e.g. the PDF of all lines and pages for this job) to the
	// io.Writer. Will return the total number of pages.
	EndJob(io.Writer) (int, error)
}

Job is the interface that each virtual printers must implement to receive print jobs.

func New1403

func New1403(font []byte, fontsize float64, skipLines int, forceUpper,
	drawBG bool, dark, light ColorRGB) (Job, error)

VintageMono use font size 11.4; worn use 10

func NewProfile

func NewProfile(profile string, fontOverride []byte,
	sizeOverride float64) (Job, error)

Jump to

Keyboard shortcuts

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