How go-pdf/fpdf works
GoFPDF is an archived Go library for generating PDF documents. The principal workflow is a Go application configuring a document, adding pages and content, then writing PDF output. Its source tree also shows support for fonts, images, SVG, templates, layout helpers, attachments, layers, and optional integrations for barcodes and importing PDFs. The README only identifies the product and its archived status; it does not document the internal call flow, so unverified relationships are shown as dashed with no evidence path.
Main entry points: fpdf.go PDF document API · font.go Font handling · barcode.go Barcode integration · gofpdi.go PDF page import
Components 22
PDF generation
- PDF document API
fpdf.go - Document defaults
def.go - PDF output writer
wbuf.go - PDF utilities
util.go
Document content
- Text and Unicode
fpdftrans.go - Grid layout
grid.go - Basic HTML
htmlbasic.go - Text lists
list/list.go - SVG drawing
svgbasic.go - Templates
template_impl.go - Embedded files
attachments.go - PDF layers
layer.go
Fonts and assets
- Font handling
font.go - TrueType parsing
ttfparser.go - Bundled font data
internal/files/files.go - Image handling
png.go
Optional integrations
- Barcode integration
contrib/barcode/barcode.go - PDF page import
contrib/gofpdi/gofpdi.go - HTTP images
contrib/httpimg/httpimg.go - TIFF images
contrib/tiff/tiff.go
Other components
- Go application
- Generated PDF
Connections 20
- Go application → PDF document API: uses
- PDF document API → Generated PDF: writes
- PDF document API → Document defaults: uses defaults
- PDF document API → PDF output writer: serializes through
- PDF document API → PDF utilities: uses
- PDF document API → Text and Unicode: supports
- PDF document API → Grid layout: supports
- PDF document API → Basic HTML: supports
- PDF document API → SVG drawing: supports
- PDF document API → Templates: supports
- PDF document API → Embedded files: supports
- PDF document API → PDF layers: supports
- PDF document API → Font handling: supports
- Font handling → TrueType parsing: parses fonts
- Font handling → Bundled font data: uses data
- PDF document API → Image handling: supports
- Barcode integration → PDF document API: registers images
contrib/barcode/barcode.go - PDF page import → PDF document API: imports templates
contrib/gofpdi/gofpdi.go - HTTP images → PDF document API: registers images
contrib/httpimg/httpimg.go - TIFF images → PDF document API: registers images
contrib/tiff/tiff.go