My question on these is always how it handles multi page documents. Most DOM and CSS approaches to HTML to PDF require it to fully render everything for placement before it can convert.
If you have to render something big, like a 300 page member directory for example, the approach will blow up.
I used paged.js in production and while it's definitely not fast enough to run during an HTTP request, it can render a 300 page document reasonably quickly, definitely within the 120 second TTL of our worker tasks. It can be quite finicky though and sometimes stalls on things like images that are taller than a single page.
Add to this a pdf to html converter, with a focus on official forms (e.g. irs tax forms), ability to easily edit fields and add signatures (similar to how the free android adobe app does it), and you can charge money for it.
Thanks - indeed there is likely a market for it. One of the issues is that to get a commercial app, you have to solve for most of the edge cases and make sure it has a good enough UI for the non sophisticated.
I was thinking about doing it, but it would be a lot of work to do right. By right, I would want it to be the quality of sublime or emacs / vim :) :)
You'd essentially have a pdf editor that can import a pdf, edit it and export the html back to pdf. Working with official forms is one usecase. Another is an iframe that can preview pdfs without resorting to plugins.
Actually, there's one more usecase for a html to pdf converter: making a book-style copy of a multipage website. I'm looking right now at a scientific site with content spread over multiple pages and it's tiring to find and click all the links to make sure I don't miss anything.
Basically you can use CSS to manage their layout - dimensions, positioning, scaling, etc. Should work pretty well
If you want floating images (e.g. text on the left, images on the right), it may be a bit more difficult and not perfectly possible. This guide will help: https://www.pagedjs.org/page-floats/ One tricky part is if you want to have text within images and have them the same size as your main text (eg in MS Word where you can have shapes and text boxes). For that, you can probably get close enough with a simple image load, and more precise by using svg graphics, but it may result in a reasonable amount of complexity to make perfect (if at all). For charts, use charts.js in my opinion.
Comments (265) 53 threads
Earlier commentsIf you have to render something big, like a 300 page member directory for example, the approach will blow up.
And you can also check https://villachiragan.saintraymond.toulouse.fr/impression to see HD images.
Both went straight to the printshop.
I was thinking about doing it, but it would be a lot of work to do right.
By right, I would want it to be the quality of sublime or emacs / vim :) :)
How about images? How do you handle images; their layout, scaling etc?
If you want floating images (e.g. text on the left, images on the right), it may be a bit more difficult and not perfectly possible. This guide will help: https://www.pagedjs.org/page-floats/
One tricky part is if you want to have text within images and have them the same size as your main text (eg in MS Word where you can have shapes and text boxes). For that, you can probably get close enough with a simple image load, and more precise by using svg graphics, but it may result in a reasonable amount of complexity to make perfect (if at all).
For charts, use charts.js in my opinion.
All comments shown.
Couldn't load more comments. Check your connection and try again.