Library to convert HTML to pdf in Golang

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • go-wkhtmltopdf

    Go bindings for wkhtmltopdf and high-level HTML to PDF conversion interface (by adrg)

  • I haven't needed to create PDFs in Go but a quick search brought this library up: https://github.com/adrg/go-wkhtmltopdf

  • bagme

    boxes and glue made easy - a PDF rendering library for Go using boxes and glue

  • https://github.com/speedata/bagme might do what you want. Not production ready but perhaps good enough for basic needs.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • rod

    A Devtools driver for web automation and scraping

  • gotex

    LaTeX to PDF print µService in Go

  • Settled down on simple LaTeX→PDF conversion. See for example https://github.com/dim13/gotex

  • lazypress

    Convert HTML pages to PDFs looking just like they would render in the browser

  • Not a library per se but you can check the code it uses: https://github.com/alexferrari88/lazypress

  • unipdf

    Golang PDF library for creating and processing PDF files (pure go)

  • I'm not the person you asked, but what about: https://github.com/unidoc/unipdf

  • sprig

    Useful template functions for Go templates.

  • I'd highly recommend tossing in the sprig library and depending on how you break up your templates, maybe creating a custom "include" helper instead of using the built in define/template helpers. The advantage of this is that if each template is capable of rendering itself independently, you can potentially render all of your templates in parallel.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • WeasyPrint

    The awesome document factory

  • In a recent project I used https://github.com/Kozea/WeasyPrint/ it is written in python, so you will need to use it like so:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts