Comment 33 for bug 2026200

Revision history for this message
Michaelus (szabo-michael-a) wrote :

OK -- I've implemented my likely permanent fix:

Instead of having the server/backend generate an HTML document, and calling chromium-browser on the CLI to generate the PDF, and returning the PDF as base64 to the "client" where a BLOB URL is generated and embedded in an <iframe> to the user, with [Print] [Save] and [Close] buttons in the modal/dialog, I'm generating the same html, adding `onload="window.print()` to the <body> tag within the HTML markup, and when returning to the client, adding an <iframe> to the page on-the-fly, and the `onload="window.print()` will trigger the client's own browser "Print Dialog" where they can select >> "Save as PDF"

It doesn't have the same user-experience, being able to "preview" the PDF before committing it to a local file and/or printing it to actual paper, but it:

a) solves the immediate problem
b) allows me to remove chromium-browser as a dependency altogether

Thanks a lot !