Documentation
¶
Overview ¶
Package pdftest builds small pdfs in memory for tests that need a real text layer
Index ¶
- func Build(pages [][]string, composite bool) []byte
- func BuildEncoded(pages [][]string, name string, charset *charmap.Charmap) []byte
- func BuildGlyphs(pages [][]string) []byte
- func EncryptPDF(t *testing.T, pdf []byte, userPW string) []byte
- func MinimalPDF(t *testing.T) []byte
- func Repeat(lines []string, count int) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build writes a pdf with one page per entry, each line of text on its own row. composite selects a Type0 font with a ToUnicode map so the text is encoded as two byte glyph ids
func BuildEncoded ¶
BuildEncoded writes a pdf in a simple font that declares the named base encoding, such as MacRomanEncoding, with every line encoded through charset the way that encoding stores it
func BuildGlyphs ¶
BuildGlyphs writes a pdf in the composite font that places every glyph on its own, leaving word gaps only in the Td distance, the way some html to pdf renderers lay out text
func EncryptPDF ¶
EncryptPDF returns pdf encrypted with AES-256, an owner password, and the given user password
func MinimalPDF ¶
MinimalPDF returns a single page pdf with one line of text
Types ¶
This section is empty.