Help us shape the future of Go! Take the 2026 Go Developer Survey

pdftest

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package pdftest writes small, valid PDFs for tests: real files PDFium opens, made in code, so no binary sits in testdata and every test says exactly what its PDF contains.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Make

func Make(pages ...string) []byte

Make returns a PDF with one page per element of pages. Each line of a page's text is set as one line in Helvetica; an empty page has no text at all, only a grey box — what a scanned page looks like to a text extractor. Text must be ASCII.

Types

type Doc

type Doc struct {
	// Title, if set, is set in 20-point type above page 1's text, as a
	// paper's title is.
	Title string
	Pages []string
	// Info is the document information dictionary: Title, Subject, a doi
	// key, as publishers write them.
	Info map[string]string
}

Doc is a PDF to write.

func (Doc) Bytes

func (d Doc) Bytes() []byte

Bytes writes the PDF.

Jump to

Keyboard shortcuts

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