PDF export images broken, HTML works fine? #1289

Closed
opened 2026-02-05 00:30:12 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @distressmess on GitHub (Aug 1, 2019).

I've cross-posted this to the solidnerd docker version of Bookstack, but just in case this is an issue sourced with dompdf or Bookstack itself:

I'm having an issue with exporting PDFs in Bookstack. I'm not sure if replacing dompdf with wkhtmltopdf might help, but I can't seem to figure out how to modify the .env as described on the Bookstack site, https://www.bookstackapp.com/docs/admin/pdf-rendering/ , while using the whole solidnerd Bookstack image, so I'm unable to test if that's the issue at the moment.

I'm running Windows 10 and Docker for Windows, as well as the solidnerd Bookstack image.

PDFs render without images, instead only giving the link to the image. This error doesn't carry over to the html export.

See below for an image example:

ruler

Thanks in advance!

Originally created by @distressmess on GitHub (Aug 1, 2019). I've cross-posted this to the solidnerd docker version of Bookstack, but just in case this is an issue sourced with dompdf or Bookstack itself: I'm having an issue with exporting PDFs in Bookstack. I'm not sure if replacing dompdf with wkhtmltopdf might help, but I can't seem to figure out how to modify the .env as described on the Bookstack site, https://www.bookstackapp.com/docs/admin/pdf-rendering/ , while using the whole solidnerd Bookstack image, so I'm unable to test if that's the issue at the moment. I'm running Windows 10 and Docker for Windows, as well as the solidnerd Bookstack image. PDFs render without images, instead only giving the link to the image. This error doesn't carry over to the html export. See below for an image example: ![ruler](https://user-images.githubusercontent.com/53479820/62295338-cce25a80-b43a-11e9-9b9c-0f84567b0187.jpg) Thanks in advance!
OVERLORD added the 🐕 Support🏭 Back-End labels 2026-02-05 00:30:12 +03:00
Author
Owner

@distressmess commented on GitHub (Aug 2, 2019):

As an update, I've tried using different image types (png, jpg) with no change. I've also tried to bring in wkhtmltopdf in a few different ways with no success, though that is probably down to my lack of experience in the field...

@distressmess commented on GitHub (Aug 2, 2019): As an update, I've tried using different image types (png, jpg) with no change. I've also tried to bring in wkhtmltopdf in a few different ways with no success, though that is probably down to my lack of experience in the field...
Author
Owner

@ssddanbrown commented on GitHub (Aug 3, 2019):

Hi @distressmess,
Sorry to hear your are experiencing issues.

I don't thinking switching WKHTML would solve this particular issue since the default DOMPDF should render images fine.

I'm assuming that BookStack is having troubling finding the images when it attempts to embed them when generating the HTML that's fed into the PDF generation library.

Have you changed the storage mechanism at all or are you using the default local storage option for images?
Have you set the APP_URL parameter in the .env file? Setting this can help in locating local image files.

@ssddanbrown commented on GitHub (Aug 3, 2019): Hi @distressmess, Sorry to hear your are experiencing issues. I don't thinking switching WKHTML would solve this particular issue since the default DOMPDF should render images fine. I'm assuming that BookStack is having troubling finding the images when it attempts to embed them when generating the HTML that's fed into the PDF generation library. Have you changed the storage mechanism at all or are you using the default `local` storage option for images? Have you set the `APP_URL` parameter in the `.env` file? Setting this can help in locating local image files.
Author
Owner

@distressmess commented on GitHub (Aug 7, 2019):

Hi Dan! The local storage mechanism is the same as the default. I believe I set app_url to http://localhost, but I'll double check with a fresh install and see if that does anything.

@distressmess commented on GitHub (Aug 7, 2019): Hi Dan! The local storage mechanism is the same as the default. I believe I set app_url to http://localhost, but I'll double check with a fresh install and see if that does anything.
Author
Owner

@Dayflare commented on GitHub (Aug 8, 2019):

i have a similar issue with pictures in the exported pdf document. The pictures are displayed but they're put under the text so the text is written over the pictures.

the first screenshot shows the page in bookstack, the second one in pdf.
msedge_2019-08-08_14-07-44
AcroRd32_2019-08-08_14-08-15

maybe this has something to do with @distressmess issue.

@Dayflare commented on GitHub (Aug 8, 2019): i have a similar issue with pictures in the exported pdf document. The pictures are displayed but they're put under the text so the text is written over the pictures. the first screenshot shows the page in bookstack, the second one in pdf. ![msedge_2019-08-08_14-07-44](https://user-images.githubusercontent.com/42730126/62702093-2b34ad80-b9e6-11e9-9aaa-634707697f0f.png) ![AcroRd32_2019-08-08_14-08-15](https://user-images.githubusercontent.com/42730126/62702104-2f60cb00-b9e6-11e9-83a5-c0f4f220859b.png) maybe this has something to do with @distressmess issue.
Author
Owner

@distressmess commented on GitHub (Aug 8, 2019):

Ahhh, I solved it! Partially inspired by issue #799 (https://github.com/BookStackApp/BookStack/issues/799)

For future reference of anyone with the same issue, I followed the steps on the Solidnerd guide, but since I was a little confused by how to actually call the containers, I typed them in full lines in PowerShell while doing a fresh install of the Bookstack setup:

  1. docker pull solidnerd/bookstack
  2. docker network create bookstack_nw
  3. docker run -d --net bookstack_nw -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=bookstack -e MYSQL_USER=bookstack -e MYSQL_PASSWORD=secret --name="bookstack_db" mysql:5.7.21
  4. docker run -d --net bookstack_nw -e DB_HOST=bookstack_db:3306 -e DB_DATABASE=bookstack -e DB_USERNAME=bookstack -e DB_PASSWORD=secret -e APP_URL=http://127.0.0.1:8080 -p 8080:80 solidnerd/bookstack:latest
  5. docker ps -a
  6. docker start (whatever the name of your database is)
  7. docker start (whatever the name of your bookstack instance is)

And then go to your app url to find a working copy of Bookstack with images functioning in the PDF exports!

Hopefully these instructions are easy enough that anyone with the same issue later and similar noob-levels of sysadmin stuff can make it work. :D

@distressmess commented on GitHub (Aug 8, 2019): Ahhh, I solved it! Partially inspired by issue #799 (https://github.com/BookStackApp/BookStack/issues/799) For future reference of anyone with the same issue, I followed the steps on the Solidnerd guide, but since I was a little confused by how to actually call the containers, I typed them in full lines in PowerShell while doing a fresh install of the Bookstack setup: 1. docker pull solidnerd/bookstack 2. docker network create bookstack_nw 3. docker run -d --net bookstack_nw -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=bookstack -e MYSQL_USER=bookstack -e MYSQL_PASSWORD=secret --name="bookstack_db" mysql:5.7.21 4. docker run -d --net bookstack_nw -e DB_HOST=bookstack_db:3306 -e DB_DATABASE=bookstack -e DB_USERNAME=bookstack -e DB_PASSWORD=secret -e APP_URL=http://127.0.0.1:8080 -p 8080:80 solidnerd/bookstack:latest 5. docker ps -a 6. docker start (whatever the name of your database is) 7. docker start (whatever the name of your bookstack instance is) And then go to your app url to find a working copy of Bookstack with images functioning in the PDF exports! Hopefully these instructions are easy enough that anyone with the same issue later and similar noob-levels of sysadmin stuff can make it work. :D
Author
Owner

@distressmess commented on GitHub (Aug 8, 2019):

I'll leave it up to Dan whether to close this or to see if Dayflare's issue has the same base.

@distressmess commented on GitHub (Aug 8, 2019): I'll leave it up to Dan whether to close this or to see if Dayflare's issue has the same base.
Author
Owner

@ssddanbrown commented on GitHub (Dec 17, 2020):

I'll close this off since the original author's issue was solved and since this is now relatively old.

@ssddanbrown commented on GitHub (Dec 17, 2020): I'll close this off since the original author's issue was solved and since this is now relatively old.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1289