I wanted to use KnpSnappy for my project to convert html to pdf and I followed the instructions from https://github.com/KnpLabs/KnpSnappyBundle. At First I tried it locally and everything worked perfectly.
And than I wanted to upload it on my Virtualserver (with plesk). There I changed the binary path of wkhtmltopdf. Because I tested it on Windows before and my Server is running with ubuntu.
I also installed wkhtmltopdf over the ssh and I tried it via wkhtmltopdf --version. It works but when i try it in symfony the page doesn't load anymore, I get the exception ERR_TOO_MANY_REDIRECTS.
.env:
###> knplabs/knp-snappy-bundle ###
WKHTMLTOPDF_PATH=/usr/local/bin/wkhtmltopdf
WKHTMLTOIMAGE_PATH=/usr/local/bin/wkhtmltoimage
###< knplabs/knp-snappy-bundle ###
config/packages/knp_snappy.yaml:
knp_snappy:
pdf:
enabled: true
binary: '%env(WKHTMLTOPDF_PATH)%'
options:
enable-local-file-access: true
image:
enabled: true
binary: '%env(WKHTMLTOIMAGE_PATH)%'
options:
enable-local-file-access: true
So this is the current Situation, I hope someone can help me.
try with https://github.com/h4cc/wkhtmltopdf-amd64
and then in the config the path should be something like this: