u/Immediate_Life7579

Five years of Go libraries for document layout and PDF generation
▲ 20 r/golang

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.

u/Immediate_Life7579 — 19 hours ago
▲ 4 r/pdf

PDF accessibility checker

There have been a number of post recently where people show off their new “Acrobat killer” or another free online PDF editing tool. I'd like to put my 2 cents in the jar: I have create a browser-based PDF accessibility checker that also displays the structure of the document. It is privacy aware: the PDF is not sent to any sever, everything runs in the browser (it uses Web assembly).

The example PDF with math is generated with boxes and glue (https://github.com/boxesandglue/boxesandglue-examples/tree/main/bagme/basic/math)

The link is https://pdfuacheck.speedata.de Any feedback is welcome. The library is OpenSource.

u/Immediate_Life7579 — 18 days ago
▲ 2 r/golang

The bidi (bidirectional typesetting - useful for right-to-left languages and especially mixed direction) code in x/text/unicode has some really bad bugs and has not been updated in a while. I have created pull request with detailed descriptions and tests, but nobody seems to care.

Is there any news if this is still maintained? What can I do to get this fixed - any ideas are appreciated.

reddit.com
u/Immediate_Life7579 — 2 months ago