
Five years of Go libraries for document layout and PDF generation
Most Go PDF libraries focus on drawing primitives or generating reports from templates. Over the last five years I've been working on a different approach: a layout engine that handles paragraphs, pagination, tables, images, footnotes, etc., with a strong focus on accessible PDFs.
That started with boxesandglue, but gradually grew into a small ecosystem:
- boxesandglue: a Go library for document layout and PDF generation
- htmlbag/bagme: HTML/CSS to PDF built on top of boxesandglue
- glu: Markdown to accessible PDF including math
- plus supporting libraries for XML, XPath, XSLT and document processing
Everything is open source, and I recently put together an interactive map showing how the projects relate to each other:
https://constellation.speedata.de
I'd be interested in hearing what other Go developers think.
My background is another (OpenSource) software which I use for my work (the speedata Pubisher, started with it almost 15 years ago). It is built on top of LuaTeX (the modern typesetting software with excellent typography) and focusses on product catalogs and data sheets. The handling of the deployment (I use custom Go based shared libraries which are linked during runtime to the LuaTeX binary and accessed from within Lua) is rather complicated, so my goal was to re-create TeX's typography in a modern setting.