wkhtmltopdf generating wrong TOC links #2019

Closed
opened 2026-02-05 02:32:22 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @dyzdyz010 on GitHub (Jan 7, 2021).

Describe the bug
I'm using linuxserver/bookstack docker image. When I export the page to pdf with wkhtmltopdf and open it, click one of the TOC links, it doesn't take me to the correct location and showing meaningless link address, like file:///tmp/knp_snappy5ff65ed5491ae7.13561238.html.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Create a page with some headers
  2. Configure BookStack to use wkhtmltopdf for pdf-generating
  3. Export and open
  4. Click one of the TOC links

Expected behavior
Clicking a TOC title link should take me to the corresponding content position.

Screenshots
If applicable, add screenshots to help explain your problem.

2021-01-07 09 44 24

2021-01-07 09 44 29

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): v0.30.7
  • PHP Version: 7.3.25
  • Hosting Method (Nginx/Apache/Docker): Docker

Additional context
Also no bookmarks for TOC.

Originally created by @dyzdyz010 on GitHub (Jan 7, 2021). **Describe the bug** I'm using [linuxserver/bookstack](https://hub.docker.com/r/linuxserver/bookstack) docker image. When I export the page to pdf with `wkhtmltopdf` and open it, click one of the `TOC` links, it doesn't take me to the correct location and showing meaningless link address, like `file:///tmp/knp_snappy5ff65ed5491ae7.13561238.html`. **Steps To Reproduce** Steps to reproduce the behavior: 1. Create a page with some headers 2. Configure BookStack to use `wkhtmltopdf` for pdf-generating 3. Export and open 4. Click one of the TOC links **Expected behavior** Clicking a TOC title link should take me to the corresponding content position. **Screenshots** If applicable, add screenshots to help explain your problem. ![2021-01-07 09 44 24](https://user-images.githubusercontent.com/1324420/103840704-078b0080-50cd-11eb-83d5-e919fa13c574.jpg) ![2021-01-07 09 44 29](https://user-images.githubusercontent.com/1324420/103840713-0d80e180-50cd-11eb-9bb4-0d9a9bd18a2c.jpg) **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): v0.30.7 - PHP Version: 7.3.25 - Hosting Method (Nginx/Apache/Docker): Docker **Additional context** Also no bookmarks for TOC.
Author
Owner

@maggie44 commented on GitHub (Jan 14, 2021):

I am experiencing the same issue. Also using the linuxserver image. I noted an issue open over there, but appears to be for an unrelated point but wanted to flag it: https://github.com/linuxserver/docker-bookstack/issues/76

@maggie44 commented on GitHub (Jan 14, 2021): I am experiencing the same issue. Also using the linuxserver image. I noted an issue open over there, but appears to be for an unrelated point but wanted to flag it: https://github.com/linuxserver/docker-bookstack/issues/76
Author
Owner

@maggie44 commented on GitHub (Jan 25, 2021):

I tried this in the development environment today, and didn't have any issues. I then tried it in the Solidnerd Docker container, and did have the issue.

Process of elimination has narrowed this down to the version of wkhtmltopdf running:

Development environment: wkhtmltopdf 0.12.6 (with patched qt)
Linuxserver: wkhtmltopdf 0.12.5
Solidnerd: wkhtmltopdf 0.12.5

  1. So I updated the Linuxserver image to the 0.12.6 (actually I bumped the Alpine container version to .13, which then pointed it to the new repository which had the 0.12.6 in it). But the issue still occurred.

  2. Then I pulled the latest build directly from the website (https://wkhtmltopdf.org/downloads.html) into the Solidnerd container, and the issue was resolved.

The difference, is in 1. the wkhtmltopdf version became: 0.12.6. In scenario 2. the version became: wkhtmltopdf 0.12.6 (with patched qt)

The solution then it appears, is to install wkhtmltopdf 0.12.6 (with patched qt, more can be read about qt here: https://wkhtmltopdf.org/downloads.html).

This should be relatively easy for the Solidnerd container, it can pull directly from the website rather than use the Buster repository.

For the Linuxserver though, which is Alpine Linux, there doesn't appear to be a version compatible with MUSL, so wasn't able to get the QT version installed.

Will log an issue in each repo accordingly.

@maggie44 commented on GitHub (Jan 25, 2021): I tried this in the development environment today, and didn't have any issues. I then tried it in the Solidnerd Docker container, and did have the issue. Process of elimination has narrowed this down to the version of wkhtmltopdf running: Development environment: wkhtmltopdf 0.12.6 (with patched qt) Linuxserver: wkhtmltopdf 0.12.5 Solidnerd: wkhtmltopdf 0.12.5 1. So I updated the Linuxserver image to the 0.12.6 (actually I bumped the Alpine container version to .13, which then pointed it to the new repository which had the 0.12.6 in it). But the issue still occurred. 2. Then I pulled the latest build directly from the website (https://wkhtmltopdf.org/downloads.html) into the Solidnerd container, and the issue was resolved. The difference, is in 1. the wkhtmltopdf version became: 0.12.6. In scenario 2. the version became: wkhtmltopdf 0.12.6 (with patched qt) The solution then it appears, is to install wkhtmltopdf 0.12.6 (with patched qt, more can be read about qt here: https://wkhtmltopdf.org/downloads.html). This should be relatively easy for the Solidnerd container, it can pull directly from the website rather than use the Buster repository. For the Linuxserver though, which is Alpine Linux, there doesn't appear to be a version compatible with MUSL, so wasn't able to get the QT version installed. Will log an issue in each repo accordingly.
Author
Owner

@ssddanbrown commented on GitHub (Oct 3, 2022):

I'm going to close this off as an upstream/environment specific issue.

@ssddanbrown commented on GitHub (Oct 3, 2022): I'm going to close this off as an upstream/environment specific issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2019