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.
Click to show internal directories.
Click to hide internal directories.