Examples

Examples

Browse code examples with generated PDF output for gpdf

Explore working examples that demonstrate gpdf's features. Each example shows code in three formats — Builder API, JSON Schema, and Go Template — alongside the generated PDF output.

Categories

Basics

Hello World, text styling, and color system fundamentals.

Layout

12-column grid, fixed-height rows, lines, spacers, page sizes, and margins.

Tables

Basic tables, styled tables, tables in columns, and vertical alignment.

Text

Letter spacing, text indent, and text decoration (underline, strikethrough).

Images

Image embedding, fit modes, alignment, transparency, and file path loading.

Document

Multi-page documents, headers & footers, metadata, and page numbering.

Business Documents

Invoice, report, QR code, barcode, and combined QR/barcode invoice.