Live data from Hacker News

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

htmldocs.com

71–80 of 94 posts

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

#71
post #49

I've used flying saucer pdf[1] for this in the past, but the missing piece always seems to be a descent WYSIWYG template editor. Either open source or paid. Any suggestions on a web solution that allows non-devs to make great templates would be appreciated. Historically I've built something simple with Tiny and added a preview button to render, but that super clunky. [1] https://github.com/flyingsaucerproject/flyings…

Oh wow. I started Flying Saucer 20 years ago. I’m amazed it’s still in use.

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

#73
post #53

Earlier quoted context omitted.

As the maintainer of wkhtmltopdf @ Odoo I can tell you it's not WebKit. Instead it's outdated WebKit from 2014 running on top of QT4 '^^

@monax Since you're the maintainer, I'll assume you no doubt will know more about it than me. But from what I (vaguely) recall, it's worse than that. Not at liberty to elaborate on exact details, but not so long ago I had to deal with wkhtmltopdf, when it turned out to be the (still preferred/recommended) PDF rendering solution as part of a major popular web middle-ware framework, at a large corporate client. I was r…

It seems you have more information about this situation than I do, as I recently took on the role of project maintainer and wasn't involved from the start.

I find the bug you mentioned interesting, and I'll promptly investigate to determine if it still exists. If I remember correctly, there's a --dpi option that may have already resolved this issue.

I share your concern about the code's state; it's problematic as it's currently leaking file descriptors and memory all over the place. We experimented with Puppeteer as an alternative, but its speed and memory usage were too high for our specific use case, so we're currently stuck with the current wkhtmltopdf.

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

#74
post #73

Earlier quoted context omitted.

@monax Since you're the maintainer, I'll assume you no doubt will know more about it than me. But from what I (vaguely) recall, it's worse than that. Not at liberty to elaborate on exact details, but not so long ago I had to deal with wkhtmltopdf, when it turned out to be the (still preferred/recommended) PDF rendering solution as part of a major popular web middle-ware framework, at a large corporate client. I was r…

It seems you have more information about this situation than I do, as I recently took on the role of project maintainer and wasn't involved from the start. I find the bug you mentioned interesting, and I'll promptly investigate to determine if it still exists. If I remember correctly, there's a --dpi option that may have already resolved this issue. I share your concern about the code's state; it's problematic as it'…

Just to clarify, I'm not bashing wkhtmltopdf. I think it is a great tool (or at least it was), for what it was initially designed for. I've used it myself several times, to great effect. Albeit mostly long ago (about a decade or so).

I'm not even concerned all that much about the code's state itself, rather that it still shows up today. In situations it was probably never designed for. Adding to that, it now often appears wrapped inside some interfacing layer/code, binding it to whatever other software it is embedded in. But then only exposing part of wkhtmltopdf. Case in point, the --dpi option you mentioned (which indeed might fix the mentioned bug), was simply inaccessible through how the framework interfaced with wkhtmltopdf (which was a design cluster-F# in its own right).

However, the bigger elephant in the room for me is that the HTML/CSS support has changed considerably over the last decade, with wkhtmltopdf pretty much stuck in time. It's just pretty much a random hit or miss when it comes to rendering any modern web content. Only for carefully crafted (legacy) content does it still make a good use case.

I won't blame wkhtmltopdf for that though, but I sure haves questions for those who apparently still consider it a valid tool for integration into modern web frameworks. I guess part of that comes down to unintentional ignorance, not knowing what they are actually integrating. Another reason might be that I've not seen much of a better sort-of-drop-in replacement for wkhtmltopdf, so people stick to it far a lack of a proper alternative. Maybe some of the people who integrated wkhtmltopdf elsewhere are even very well aware of all the limitations/dangers. Still, little use of that if that knowledge is lost on those who subsequently end up using it, primarily just as consumers.

Puppeteer is a very different beast in its own right, regardless which engine/browser you end up using. But if more modern html/css features are required, it can be a valid replacement (regardless of numerous downsides nonetheless). Still, I (also) doubt that it will work as a good replacement for all of wkhtmltopdf's use cases.

If nothing else, I got some free entertainment out of it all .. watching the shocked expression on the faces of top-level suits, when I explained to them what they had been blissfully unaware of. They had good reasons to be worried, because this exposure should have been caught by their rigorous technology-review procedures. However, it had been an ad-hock dependencies that was introduced as part of a legit feature request. The dev had probably never even noticed, because it appeared as a native framework functionality (hiding any obvious reference to using wkhtmltopdf under the hood). Anyways, wkhtmltopdf is certainly not to be blamed for that.

Still, it does illustrate the dangers of modern-day software integration. I think especially in (web) frameworks, where the name of the game often appears to have turned towards a popularity contest (with competing frameworks) and "making things as simple as possible". Something about a road paved with good intentions.

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

#75
post #49

I've used flying saucer pdf[1] for this in the past, but the missing piece always seems to be a descent WYSIWYG template editor. Either open source or paid. Any suggestions on a web solution that allows non-devs to make great templates would be appreciated. Historically I've built something simple with Tiny and added a preview button to render, but that super clunky. [1] https://github.com/flyingsaucerproject/flyings…

Oh wow. I started Flying Saucer 20 years ago. I’m amazed it’s still in use.

It does the job very nicely, and I can easily embed on-the-fly generated images. Not sure there is a better option in the Java ecosystem.

Thanks for your long lived contribution.

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

#76

Earlier quoted context omitted.

TeX at this point has entered computing legend. It has such a long and storied life. But it’s old. We need something modern, that represents current ways to make documents from code. And that way is CSS. I bet within my lifetime most scientific publications will move to a PDF tool that ingests CSS. We just need to find something open-source and clean that has no missing functionality.

What about https://typst.app ?

Is it open source ?

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

#78

Earlier quoted context omitted.

TeX at this point has entered computing legend. It has such a long and storied life. But it’s old. We need something modern, that represents current ways to make documents from code. And that way is CSS. I bet within my lifetime most scientific publications will move to a PDF tool that ingests CSS. We just need to find something open-source and clean that has no missing functionality.

What about https://typst.app ?

I designed some worksheets in Typst and it is the best experience I've had with a typesetting system, hands down. It's not for everything but its defaults are good and very simple.

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

#79
Maybe it’s because I come from the printing world of catalogs, magazines, and books printed on web offset printers but typeset implies a level of control and precision that I’ve never seen with HTML/CSS. When I had to build a backend to generate print ready PDF files being printed on pre-printed invoice stock, it was ReportLab all the way. I needed pixel level accuracy and control.

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

#80

@kelvinzhang Quite frankly, htmldocs is the exact project i'm looking for months. I'm tired of word and same alternative and wanted something i can write html and css3 to convert to PDF. You do and in a beautiful way ! Some question : i just want to use your product be also need to be sure my doc will by avaivable in futur. what's your plan ? - opensource ? - community/enterprise ? - close source but a docker version…

The long term goal of this project is to make HTML/CSS the defacto way of typesetting PDF documents. I’ll definitely keep it running for as long as I can.

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.

Post reply on HN