128 karma · joined March 25, 2020
I originally built this because I needed a better way to generate invoices and tailor resumes to job descriptions dynamically. Existing solutions had major trade-offs:
- Google Docs/Word → Easy but lack APIs & version control
- LaTeX → Structured output but painful syntax & no API
- Figma → Flexible but not designed for automation
With htmldocs, you can:
- Define document templates and props in JSX (just like web components)
- Use modern CSS (flexbox, grid, Tailwind, etc.)
- Render server-side via a headless Chromium pipeline
- Upload templates for remote PDF generation via an API
Most of the world still runs on PDFs—contracts, reports, invoices, resumes, etc. It’s time we had a developer-first approach to document generation, just like we build for the web.
What frustrations have you had with existing document solutions? Would love to hear your ideas, experiences, and feedback.
Typst is great but there are a few key differences:
- full CSS support, allowing for more customizability and familiar styling without a learning curve
- less tailored towards academic use-cases are more towards personal/business use-cases like resumes, invoices, reports. Also adding a template gallery in the near future.
- has a templating engine and API baked in
- can use JS packages and ecosystem (ex. icon sets, fonts, etc.)
The web version is just the initial step, and will likely open source for people who want to self-host and to increase adoption. For pricing, will probably adopt a model similar to Overleaf where it’s free for most users and maybe charge for team collaboration or have an enterprise license.
@page :left {
margin-left: 20mm;
margin-right: 10mm;
}
@page :right {
margin-left: 10mm;
margin-right: 20mm;
}
instead of needing to install/import different LaTeX packages. I think for most of my current use-cases level 2 has been sufficient but I can see if I can include Paged.js polyfill support by default so there's more support for customizability on that front.- having a web editor interface without needing to re-run a CLI command
- people who don't want to deal with packages/dependencies on their own system
- users that just want an affordable and easy-to-use API to generate PDF documents instead of having to set up their own server <> task queue <> worker system which would usually cost more
- in the future, teams that want to collaborate together on a document
TOS is pretty general and just there for legal reasons, tl;dr feel free to use as you see fit as long as it's not for anything illegal.
WeasyPrint implements its own rendering engine and might support some specific @page properties that Chromium does not but given the complexity of CSS and web browsers, you're generally better off sticking with Chromium due to its history.
Also – an added benefit is that we can use JS libraries like FontAwesome, Bootstrap, KaTeX, etc. which is where other HTML to PDF libraries fall flat.