docker-bookstack icon indicating copy to clipboard operation
docker-bookstack copied to clipboard

wkhtmltopdf not found in image.

Open soflane opened this issue 2 years ago • 5 comments

linuxserver.io

After digging a bit, I found that the package wkhtmltopdf is not available for Alpine version 3.16, and make the apk add wkhtmltopdf command in the dockerfile fail

Expected Behavior

Current Behavior

Steps to Reproduce

  1. Run the container with the environment variable WKHTMLTOPDF=/usr/bin/wkhtmltopdf
  2. try to export a page in bookstack

Environment

OS: Debian 11 CPU architecture: x86_64 How docker service was installed: Official docker script

Command used to create docker container (run/create/compose/screenshot)

Docker run

Docker logs

There is no output in the docker itself, but when trying to export a page to PDF in bookstack I get the error that the binary wkhtmltopdf is not found.

The exit status code '127' says something went wrong: stderr: "sh: /usr/bin/wkhtmltopdf: not found " stdout: "" command: /usr/bin/wkhtmltopdf --lowquality --page-size 'A4' --outline --print-media-type '/tmp/knp_snappy6322017b115a82.05430218.html' '/tmp/knp_snappy6322017b1166b6.69407541.pdf'.

Sorry if my bug report is not clear enough, don't hesitate to make me correct some things !

soflane avatar Sep 14 '22 16:09 soflane

Why are you opening 2 issues about the same thing? Why not just edit/comment on your original issue you opened?

j0nnymoe avatar Sep 14 '22 16:09 j0nnymoe

Why are you opening 2 issues about the same thing? Why not just edit/comment on your original issue you opened?

Sorry, I didn't see that I made two issues by missclick

soflane avatar Sep 14 '22 19:09 soflane

We used to be able to install wkhtmltopdf using a older alpine version, but this way is now incompatible with the version we ship, as it has been dropped from the alpine repos due to being unmaintained.

Roxedus avatar Sep 15 '22 14:09 Roxedus

So, is there something planned to work around ?

soflane avatar Sep 19 '22 08:09 soflane

We are still discussing our options.

Roxedus avatar Sep 19 '22 08:09 Roxedus

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 20 '22 03:10 github-actions[bot]

+1 I would like that dependency back because de default PDR renderer is not very great

Risc-Skydoo avatar Oct 27 '22 08:10 Risc-Skydoo

+1 wkhtmltopdf would be brill!

jacojazz avatar Nov 08 '22 15:11 jacojazz

Is there something planned about this ? perhaps somebody found a workaround

Pafzedog avatar Dec 06 '22 10:12 Pafzedog

Not an elegant solution but I'm manually copying wkhtmltopdf into the container and installing the dependencies.

docker cp ./wkhtmltopdf bookstack:/usr/bin/wkhtmltopdf
docker exec -it bookstack /bin/bash
apk add --update --no-cache libgcc libstdc++ libx11 glib libxrender libxext libintl ttf-dejavu ttf-droid ttf-freefont ttf-liberation

Remember you need to do this every time you upgrade the container.

No idea what the security implications are so use at your own risk.

pwpbarney avatar Dec 06 '22 13:12 pwpbarney

Not an elegant solution but I'm manually copying wkhtmltopdf into the container and installing the dependencies.

docker cp ./wkhtmltopdf bookstack:/usr/bin/wkhtmltopdf
docker exec -it bookstack /bin/bash
apk add --update --no-cache libgcc libstdc++ libx11 glib libxrender libxext libintl ttf-dejavu ttf-droid ttf-freefont ttf-liberation

Remember you need to do this every time you upgrade the container.

No idea what the security implications are so use at your own risk.

you don't need to do this every time, you can make it automatically persistent: https://docs.linuxserver.io/general/container-customization

good work-around!

drizuid avatar Dec 27 '22 16:12 drizuid

I made a different workaround by using weasyprint, which is included in alpine, and a proxy script and installing it using container customization. https://gist.github.com/kmpm/c254558fcb0608346f49946a53cd8c09

kmpm avatar Dec 30 '22 11:12 kmpm

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jan 30 '23 02:01 github-actions[bot]

I made a different workaround by using weasyprint, which is included in alpine, and a proxy script and installing it using container customization. https://gist.github.com/kmpm/c254558fcb0608346f49946a53cd8c09

Sorry for the delay, have you fully tested this as a working replacement for wkhtmltopdf? if yes, do you mind submitting a PR?

drizuid avatar Mar 24 '23 11:03 drizuid

There are some differences in the output of weasyprint but it "works for me". It's quite easy to customize using css though. I'll look into how this can be turned into a PR.

kmpm avatar Mar 24 '23 15:03 kmpm

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 24 '23 09:04 github-actions[bot]

Same issue, it seems wkhtmltopdf is missing from the image, but is listed in the documentation.

escservices avatar Jun 05 '23 23:06 escservices

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jul 06 '23 09:07 github-actions[bot]

This issue is locked due to inactivity

github-actions[bot] avatar Oct 05 '23 09:10 github-actions[bot]