lib

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanString

func CleanString(str string) string

CleanString places escape characters with their real values and replaces tabs with a number of spaces.

func ContentBox

func ContentBox(fpdf *gofpdf.Fpdf) (width, height float64)

ContentBox returns the width and height of a page minus margins.

func ContentBoxBottom

func ContentBoxBottom(fpdf *gofpdf.Fpdf) float64

ContentBoxBottom returns the page height minus the bottom margin. Anything written below this needs to break to a new page.

func ContentBoxHeight

func ContentBoxHeight(fpdf *gofpdf.Fpdf) float64

ContentBoxHeight returns the height of a page minus top and bottom margins.

func ContentBoxRight

func ContentBoxRight(fpdf *gofpdf.Fpdf) float64

ContentBoxRight returns the page width minus the right margin. Anything written beyond this needs to wrap to a new line.

func ContentBoxWidth

func ContentBoxWidth(fpdf *gofpdf.Fpdf) float64

ContentBoxWidth returns the width of a width minus left and right margins.

func HexToRGB

func HexToRGB(s string) (r, g, b int, err error)

HexToRGB takes a hex color value and returns three ints with its red, green, and blue values. Source: https://stackoverflow.com/a/54200713/7687024

func PxToMm

func PxToMm(pixels int) float64

PxToMm converts pixels to millimeters.

Types

type EM

type EM float64

EM represents a length in Ems.

func (EM) ToF

func (em EM) ToF() float64

ToF returns an em value as a float64.

func (EM) ToPT

func (em EM) ToPT() PT

ToPT converts Ems to Points. 1em = 16px = 12pt So, do we divide by 16 or 12?

type IN

type IN float64

IN represents a length in Inches.

func (IN) ToF

func (in IN) ToF() float64

ToF returns a inch value as a float64.

func (IN) ToMM

func (in IN) ToMM() MM

ToMM converts Inches to Millimeters.

func (IN) ToPT

func (in IN) ToPT() PT

ToPT converts Inches to Points.

type MM

type MM float64

MM represents a length in Millimeters.

func (MM) ToF

func (mm MM) ToF() float64

ToF returns a millimeter value as a float64.

func (MM) ToIN

func (mm MM) ToIN() IN

ToIN converts Millimeters to Inches.

func (MM) ToPT

func (mm MM) ToPT() PT

ToPT converts Millimeters to Points.

type PT

type PT float64

PT represents a length in Points.

func (PT) ToEM

func (pt PT) ToEM() EM

ToEM converts Points to Ems.

func (PT) ToF

func (pt PT) ToF() float64

ToF returns a point value as a float64.

func (PT) ToIN

func (pt PT) ToIN() IN

ToIN converts Points to Inches.

func (PT) ToMM

func (pt PT) ToMM() MM

ToMM converts Points to Millimeters.

Jump to

Keyboard shortcuts

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