Library to convert HTML to pdf in Golang

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

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • go-wkhtmltopdf

    Handcrafted 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

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • 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.

  • rod

    A Chrome DevTools Protocol 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.

  • 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

  • How to create a PDF?

    7 projects | /r/golang | 11 Apr 2023
  • Do you know any library to make pdf in golang?

    7 projects | /r/golang | 24 Dec 2022
  • Htmd: A turndown.js inspired HTML-to-Markdown converter for Rust

    4 projects | news.ycombinator.com | 16 Jun 2024
  • Write Advanced CSS (Not Just HTML) Now Directly in Go

    1 project | news.ycombinator.com | 17 Apr 2024
  • Show HN: A PDF Processing CLI/API Written in Go

    1 project | news.ycombinator.com | 5 Mar 2024

Did you konow that Go is
the 4th most popular programming language
based on number of metions?