print

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package print runs the one-shot pipeline: parse -> render -> headless Chromium -> wait for paged.js -> page.PDF -> write to disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(doc *document.Document, thm *theme.Theme, opts Options) (string, error)

Print renders a document to PDF and writes it to disk. Returns the absolute path of the resulting PDF.

func ResolveOutputPath added in v0.1.1

func ResolveOutputPath(doc *document.Document, outputPath string) (string, error)

ResolveOutputPath returns the absolute path Print will write to: the explicit outputPath when given, otherwise <source-basename>.pdf next to the document. Exposed so callers can check for an existing file before committing to a render.

Types

type Options

type Options struct {
	// OutputPath is the PDF file to write. Empty means write next to the
	// source document as <basename>.pdf.
	OutputPath string
	// WriteHTML, if true, also writes the rendered HTML alongside the PDF
	// for debugging.
	WriteHTML bool
	// Version is propagated into the render System.Version field.
	Version string
}

Options configures Print.

Jump to

Keyboard shortcuts

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