top | item 39670235

(no title)

marceldegraaf | 2 years ago

We're using Gotenberg[1] to convert a rendered web page (with Elixir/Phoenix, in our case) to PDF. Works like a charm and we can use our existing frontend code/styling (including SVG graph generators) which is a huge bonus.

1: https://gotenberg.dev/

discuss

order

Titou325|2 years ago

We actually experimented with Gotenberg! Ultimately it is a layer on top of Chromium for conversion and we were dissatisfied with the results. I am curious so as to how are you handling assets and other static media / attachments: do you embed everything in a single HTML file or do you use some kind of bucketing system to resolve URLs?

marceldegraaf|2 years ago

Great question! We actually just use the static assets (stylesheets, images) from our public asset CDN. The generated HTML points to the latest version of those assets, which means we can always use all the latest styling/assets in our generated PDF files.

To give you an idea, this is the kind of PDF files we generate that way: https://assets.walterliving.com/documents/walter-charlotte-d...