Question - Wkhtmltopdf error in Docker installation on CentOS 7

wkhtmltopdf installed as follows:
rpm -Uvh wkhtmltox-0.12.6-1.centos7.x86_64.rpm
also, I’ve tried to install it as below:
yum install wkhtmltox-0.12.6-1.centos7.x86_64.rpm

But I have got this error when trying to generate test pdf:

“An error occurred while we tried to generate a test pdf - the configured path or the library is wrong, please review the installation”

I’ve tested the tool as follows and it’s working properly
wkhtmltopdf www.google.com test.pdf

My installation stack:

  • CentOS: 7.9
  • Selinux: Enforcing
  • Docker Engine - Community Version: 20.10.21
  • Eramba Community version: 3.16.2
  • wkhtmltopdf version: 0.12.6 (with patched qt)
  • WKHTMLTOPDF path to bin file: /usr/local/bin/wkhtmltopdf
  • access permission to wkhtmltopdf: -rwxr-xr-x. root root

Hello,

Can you try to generate this pdf:

wkhtmltopdf https://yourerambadomain/settings/test-pdf test.pdf

Eramba needs to connect to the server itself, too.

hi @sam
yes I run it and it worked just fine

I don’t have much knowledge in Docker, so is there an issue in the way I’ve installed the package?
should I install it in eramba container? how?

thanks

Ah, you are doing this directly on the server.
You have to do it from the eramba container, go into the eramba container and test from there.
docker exec -it eramba bash

I got this error:

wkhtmltopdf: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory

This workaround should help: virtualbox - Ubuntu 18.4 libQt5Core.so.5: cannot open shared object file: No such file or directory - Ask Ubuntu

strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5

We will include it in our docker image

1 Like

Thanks a lot, the command helped and it’s working, from eramba container as well as from web console