print-server: printing invoices through a spool

examples/print-server — a small business application that prints invoices. It fills an invoice template with what is typed on its page, puts the document in the queue of a print server it embeds, and shows each job as the spool sends it and the printer prints it. The page answers at once; the printing happens behind it, and survives a restart.

cd examples/print-server
go run . -fake-printer          # prints on bdf's fake IPP printer, in the same process
open http://127.0.0.1:8083/

go run . -printer ipps://printer.example.local/ipp/print   # on a printer of the network

What the server does

Why this shape

A business system that prints should not hold a request open until the printer is done, nor lose a job because the printer was off. Embedding the print server gives the application the spool's guarantees (one file, retries, no job printed twice, accounting) without another process; a larger site runs bdf printd on its own and talks to it with print/server/client or plain HTTP, as curl does.