Live data from Hacker News

Show HN: Htmldocs – Typeset and generate pdfs with HTML/CSS

htmldocs.com

1–10 of 94 posts

Show HN: Htmldocs – Typeset and generate pdfs with HTML/CSS

#1
htmldocs is an Overleaf-style editor for typesetting documents using HTML/CSS, which provides the same benefits as LaTeX while being more accessible, customizable, and familiar.

I built this because I wanted to programatically generate invoices as well as automatically tailor my resume to jobs but had no good way of generating well-formatted PDFs. I ended up building a templating engine to Chromium rendering pipeline to generate PDFs, and due to the amount of engineering effort, turned it into a tool for others that might want to do the same. There's a built-in API (https://htmldocs.com/docs/documents) that you can call to turn JSON into PDFs in a single call.

htmldocs is different from other tools like Wkhtmltopdf and Weasyprint in that it uses Chromium to generate PDFs, meaning that it supports the most modern CSS features and there's minimal drift between the rendered HTML document and PDF.

Will also consider open sourcing if there's enough interest in the project!

Show HN: Htmldocs – Typeset and generate pdfs with HTML/CSS
htmldocs.com

Re: Show HN: Htmldocs – Typeset and generate pdfs with HTML/CSS

#5
post #3

Some people might be interested in https://weasyprint.org/

Interesting, I'm looking for a solution to render PDFs at the moment, it looks like that one actually does not use chromium, unlike most tools that I've seen that render HTML to PDFs. What's the advantage? Is it more lightweight / faster / reliable?

Re: Show HN: Htmldocs – Typeset and generate pdfs with HTML/CSS

#6
> htmldocs is different from other tools like Wkhtmltopdf and Weasyprint in that it uses Chromium to generate PDFs, meaning that it supports the most modern CSS features and there's minimal drift between the rendered HTML document and PDF.

WeasyPrint is implemented as a from-scratch and specific-purpose rendering engine, so yeah, it’s different. But wkhtmltopdf uses WebKit, meaning it’s much the same as htmldocs, just backed by a different browser engine.

It’s important to realise, though, that using an existing browser engine doesn’t mean everything’s hunky-dory: in fact, when it comes to some of the things you care about with producing PDFs, some things will be worse, and the WeasyPrint approach has significant advantages. Because browsers don’t care about your use case at all. From time to time they’ll improve things incidentally, but all browsers are missing things like a lot of CSS Paged Media stuff, stuff that’s often been specified for a decade or more, where things like WeasyPrint have had them for years and years.

Re: Show HN: Htmldocs – Typeset and generate pdfs with HTML/CSS

#7
Your terms of service appear to be bogus:

> You acknowledge that the Website is a general-purpose search engine and tool. Specifically, but without limitation, the Website allows you to search multiple websites for music. Moreover, the Website is a general-purpose tool that allows you to convert audio files from videos and audio from elsewhere on the Internet. The Website may only be used in accordance with law. We do not encourage, condone, induce or allow any use of the Website that may be in violation of any law.

Re: Show HN: Htmldocs – Typeset and generate pdfs with HTML/CSS

#8
post #5
post #3

Some people might be interested in https://weasyprint.org/

Interesting, I'm looking for a solution to render PDFs at the moment, it looks like that one actually does not use chromium, unlike most tools that I've seen that render HTML to PDFs. What's the advantage? Is it more lightweight / faster / reliable?

We actually ran off of WeasyPrint at first but switched to Chromium due to emojis not rendering properly, poor flexbox support, no custom fonts, and other differences between the HTML you'd see in a browser vs. the generated PDF.

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.

Re: Show HN: Htmldocs – Typeset and generate pdfs with HTML/CSS

#10
Cool service! I like that it’s just HTML/CSS but the front end editor looks quite cool.

I also just open sourced part of my app that does PDF generation, but it’s completely bare bones.

I basically wanted a wrapper around the pdf generating part of chromium so that i could generate pdfs on pages within my own app.

Its here if anyone wants to check it out: https://github.com/awongh/bakso-doc

Post reply on HN