Web to Print - WkHtmlToPDF & PDFreactor - No images


#1

We have installed PIMCore within Docker with the following template: https://github.com/dpfaffenbauer/pimcore-docker-compose

We can print to pdf, although we do not have have any pictures.


The locations are provided, but the pictures do not load.

We guess it must be related to the Hostname (WkHTMLtoPDF) or BaseURL (PDFreactor) with the use with Docker.

According explanation on the Pimcore, this should be correct. I guess this must be related with use with Docker.


#2

did you check the logs? Or try it manually using the command Pimcore executes to generate the PDF, wkhtmltopdf or pdf-reactor usually log such issues.

I think it has to do with the docker-image, but only with something like a hostname or something.


#3

Hi,
it is important that the rendering tool (on whatever machine it lives) has access to static files and also can resolve them. So, just try a wget <HOSTNAME-IN-SETTINGS+PATH-TO-IMAGE-LIKE-IN-MARKUP> on the machine where the rendering tool lives. This should deliver the image…

BR
Christian


#4

Hey dpfaffenbauer & fash,

Thank you very much for your prompt reply.

I have verified the log and it was immediately clear.

The hostname had to be: localhost

According to the explanation on Pimcore:
In the host field, enter the full URL, like you would in a web browser, not just the hostname. For example: “http://example.mydevdomain.local

But it seems the “http://” is not necessary in this case.
As this PDF is created internally in docker, the port 2000 also has to be obsoleted.
As last, the trailing dash “/” should also be removed.

Pictures can now be processed.
I have another error concerning QSslSocket, but this will be for another topic when necessary.

Best Regards,
Verge