Documentation
¶
Overview ¶
Package printing enumerates installed printers and submits PDF documents. Submission is an explicit operation: enumeration never creates print jobs. A successful submission does not mean that paper has left the printer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoPrinters = errors.New("printing: no printers installed") ErrNoDefaultPrinter = errors.New("printing: no default printer configured") ErrPrinterNotFound = errors.New("printing: selected printer not found") ErrInvalidDocument = errors.New("printing: a readable PDF document is required") ErrInvalidOptions = errors.New("printing: invalid print options") ErrCanceled = errors.New("printing: canceled before submission") ErrSubmissionUnknown = errors.New("printing: submission status unknown; check the printer queue before retrying") )
Functions ¶
func ValidatePDF ¶
ValidatePDF rejects directories, non-PDF files and unreadable documents. It checks the signature, not full PDF validity; the system renderer performs the actual PDF validation. Absolute paths also prevent option-like filenames from being interpreted as command switches.
Types ¶
type Backend ¶
type Backend interface {
Printers(context.Context) ([]Printer, error)
SubmitPDF(context.Context, string, Options) (Job, error)
}
Backend allows applications/tests to provide an explicitly chosen spooler. SubmitPDF is called only after PDF/options/printer validation succeeds.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DefaultPrinter ¶
type Job ¶
type Job struct {
ID string
PrinterName string
// Dispatched means the PDF renderer accepted the document but exposes no
// spooler job ID. It must not be presented as verified physical printing.
Dispatched bool
}
Click to show internal directories.
Click to hide internal directories.