linuxserver / docker-bookstack

A Docker container for the BookStack documentation wiki
GNU General Public License v3.0
747 stars 108 forks source link

wkhtmltopdf not found in image. #134

Closed soflane closed 11 months ago

soflane commented 1 year ago

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 !

j0nnymoe commented 1 year ago

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

soflane commented 1 year ago

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

Roxedus commented 1 year ago

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.

soflane commented 1 year ago

So, is there something planned to work around ?

Roxedus commented 1 year ago

We are still discussing our options.

github-actions[bot] commented 1 year ago

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.

Risc-Skydoo commented 1 year ago

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

jacojazz commented 1 year ago

+1 wkhtmltopdf would be brill!

Pafzedog commented 1 year ago

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

pwpbarney commented 1 year ago

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.

drizuid commented 1 year ago

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!

kmpm commented 1 year ago

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

github-actions[bot] commented 1 year ago

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.

drizuid commented 1 year ago

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?

kmpm commented 1 year ago

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.

github-actions[bot] commented 1 year ago

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.

escservices commented 1 year ago

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

github-actions[bot] commented 1 year ago

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] commented 10 months ago

This issue is locked due to inactivity