A precise, testable document engine for production Go services.
One call to render HTML, or a structured component grid built from rows and columns. Invoices, reports, forms, labels, certificates — generated fast, with explicit control over every element on the page.
| Item | Qty | Amount |
|---|---|---|
| Document API — Team | 1 | $480.00 |
| Rendering credits | 12k | $240.00 |
| Priority support | 1 | $120.00 |
package main import "github.com/avdoseferovic/paper" func main() { doc, _ := paper.FromHTML(invoiceHTML) _ = doc.Save("invoice.pdf") }
m := paper.New() m.AddRow(12, text.NewCol(8, "Invoice"), code.NewQrCol(4, url), ) doc, _ := m.Generate() // component tree → PDF b := doc.GetBytes()
Paper gives you both ends of the spectrum — render existing markup in a single call, or build pixel-deterministic layouts from a typed component grid. Mix them freely.
Bring your own templates. Pass an HTML string or fragment and get a print-ready PDF back. Ideal for migrating existing documents.
doc, err := paper.FromHTML(tmpl) if err != nil { return err } b64 := doc.GetBase64()
Compose documents from rows and columns on a 12-column grid. Every element is a typed component you can test, reuse, and inspect.
m.AddRow(12, text.NewCol(6, header), code.NewBarCol(6, sku), )
Drop these into any column. Compose your own from them. Each one renders deterministically and can be inspected in tests.
The same mental model as the web — but resolved to exact points on the page. Spans add up to twelve; Paper measures, positions, and paginates.
Each row opens a 12-unit track. Add columns with a span and Paper handles the math.
Any component — or a nested row — drops into a column. Composition all the way down.
Content that overflows the page flows predictably to the next, headers and footers intact.
Paper parses your markup, resolves it into the same component tree the grid API produces, then renders to an exact, paginated PDF.
<section class="invoice"> <h1>Invoice</h1> <table> <tr><td>API</td> <td>$480</td></tr> </table> <img src="qr.png" /> </section>
Because every document is a component tree, you can unit-test structure without rendering a single pixel — then watch generation behavior with optional metrics.
Anywhere you generate paper, on demand, at volume.
Add Paper to your Go service and generate production PDFs in a single import.