ghostscript

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoGhostscript = errors.New("cannot run ghostscript")

Functions

func FindTextPos

func FindTextPos(v pdf.Version, paper *pdf.Rectangle, setup func(page *document.Page) error) (x, y float64, err error)

FindTextPos finds the approximate text position in user coordinates, after the f function has been called to draw some text. When f is called, the content stream is at the beginning of a new text object. The function should not end the text object.

func Render

func Render(t *testing.T, pdfWidth, pdfHeight float64, v pdf.Version, f func(page *document.Page) error) image.Image

Render can be used in unit tests to render a PDF page to an image.

This calls the ghostscript command-line tool to render the PDF page to a PNG image. The image is returned as a Go image.Image object.

We use this function to verify that Ghostscript's idea of PDF matches our own.

Types

This section is empty.

Jump to

Keyboard shortcuts

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