printing

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package printing prints HTML or a PDF with the system's print dialog.

nimbus native plugin add printing

err := printing.Print(ctx, printing.Options{Name: "Receipt 1042", HTML: "<h1>Thank you</h1>"})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(ctx context.Context, o Options) error

Print opens the dialog. On iOS it returns when the dialog closes, and fails with plugin.Cancelled if they back out. Android returns as it opens, and can't tell.

Types

type Options

type Options struct {
	Name string `json:"name,omitempty"` // the job's name, shown in the dialog
	HTML string `json:"html,omitempty"` // a page to print
	PDF  []byte `json:"pdf,omitempty"`  // or a PDF to print
}

Options is what to print: set HTML or PDF.

Jump to

Keyboard shortcuts

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