DEV Community

Cover image for HTML to PDF in GO
Juan Pablo Ramirez
Juan Pablo Ramirez

Posted on

1 1

HTML to PDF in GO

Recently I had a project that required to get thousands of URL's and convert them into PDF. After reviewing a few and complicated tools I decided to create my own.

I admit that I'm bias towards GO, as I believe is an extremely versatile, fast and easy to pick up language. I did tried to write the same in Python, but this small tools cost me around 2 hours in GO, while.. in python in my case I would be still looking for examples and code styles.

Another was the package system, I really like the whole concept of sending only a binary thing.

It's simple enough for now, as it just uses chromium browser to do the PDF, I added classes and functions to also read an Excel file, as my project required to do it.

I think that the best part is the command line capabilities, the configuration file and the usage of the makefile to automate the building and the release in github.

I will continue to add functionality to this tool, please , feel free to comment, ask for features, PR and so on.

https://github.com/epyphite/html2pdf

Thanks!!

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (1)

Collapse
 
mattmccullo profile image
Matt McCullough

Conveniently you can use the Go SDK at inkit.com to get running quickly with converting HTML files to PDF

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay