pimcore / web-to-print-bundle

Web-to-Print community bundle adds web-to-print features to Pimcore documents.
https://pimcore.com/docs/platform/Web_To_Print/
Other
4 stars 12 forks source link

[Gotenberg] Set assets #33

Closed matthiashamacher closed 1 year ago

matthiashamacher commented 1 year ago

Possible solution for #32

If the processor is Gotenberg we do not set absolute paths for the additional files but just return them. Then we have a new function that goes through the html similar to the Mail::setAbsolutePaths function and gets all the images. There the full local path is generated from the image path and saved along with the filename in a new array. The path in the html will be replaced with only the filename so it is on root level. At last, the assets in the new array will be loaded as stream and sent together with everything else to Gotenberg to render the PDF.

As mentioned in the issue this is not a really nice solution but its working for us.

kingjia90 commented 1 year ago

@matthiashamacher Could you please verify if https://github.com/pimcore/web-to-print-bundle/pull/41 fixes it? It worked before and then i've found that this gotenbergHostUrl could be subtly empty