A Go wrapper for wkhtmltopdf that provides a type-safe interface to generate PDFs from HTML.
go-wkhtmltopdf is a Go wrapper for the wkhtmltopdf command-line tool, allowing developers to generate PDF documents from HTML/CSS templates directly within Go applications. It solves the need for creating customizable, print-ready documents like invoices and reports by leveraging HTML's styling capabilities. The library provides a type-safe, idiomatic Go API that simplifies wkhtmltopdf's extensive options.
Go developers who need to generate PDFs from HTML in server-side applications, such as web services generating invoices, reports, or other printable documents.
Developers choose go-wkhtmltopdf for its type-safe interface that reduces errors and enhances IDE support, its flexibility in handling multiple HTML sources, and its JSON serialization feature for distributed PDF generation workflows.
Golang commandline wrapper for wkhtmltopdf
All wkhtmltopdf settings are exposed as typed struct fields, ensuring compile-time safety and IDE autocompletion, as demonstrated in the code examples for Dpi, PageSize, and other options.
Supports combining HTML from URLs, local files, or in-memory readers via stdin, allowing versatile document assembly in a single PDF, as shown with NewPage and NewPageReader.
Configurations can be saved and loaded as JSON, enabling client-server setups or AWS Lambda integration, with examples provided for NewPDFPreparer and NewPDFGeneratorFromJSON.
Relies on wkhtmltopdf, which is archived and no longer maintained, meaning no updates, security fixes, or compatibility with new web standards, as explicitly warned in the README.
Requires wkhtmltopdf to be installed separately on the system, adding deployment complexity and potential versioning issues, with path resolution noted as a setup step.
Speed is limited by wkhtmltopdf's rendering engine, which may not be optimal for high-volume or real-time generation compared to native Go libraries or headless browsers.
A PDF processor written in Go.
The Universal Filesystem Abstraction for Go
Fast disk usage analyzer with console interface written in Go
File system event notification library on steroids.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.