PDF Export issue #332

Closed
opened 2026-02-04 18:31:35 +03:00 by OVERLORD · 32 comments
Owner

Originally created by @Dav31 on GitHub (May 11, 2017).

  • BookStack Version: 0.16.2
  • PHP Version: 5.6.30
  • MySQL Version: 5.5.52-MariaDB

Hi,
Firstly, thank's a lot for this tool.
Secondly, I have an issue with PDF exports.
When I try to export an article as PDF, all images are missing from the file created.

I tried to use WKHTMLTOPDF instead, but without success.

Originally created by @Dav31 on GitHub (May 11, 2017). * BookStack Version: 0.16.2 * PHP Version: 5.6.30 * MySQL Version: 5.5.52-MariaDB Hi, Firstly, thank's a lot for this tool. Secondly, I have an issue with PDF exports. When I try to export an article as PDF, all images are missing from the file created. I tried to use WKHTMLTOPDF instead, but without success.
OVERLORD added the 🐛 Bug label 2026-02-04 18:31:35 +03:00
Author
Owner

@ssddanbrown commented on GitHub (May 28, 2017):

Hi @Dav31, Sorry for my late reply. Were the images uploaded via BookStack or are the referencing another website? What OS is your BookStack instance running on? How large are the images?

@ssddanbrown commented on GitHub (May 28, 2017): Hi @Dav31, Sorry for my late reply. Were the images uploaded via BookStack or are the referencing another website? What OS is your BookStack instance running on? How large are the images?
Author
Owner

@Dav31 commented on GitHub (May 29, 2017):

Hi Dan,

No problem for the late.
Yes, the images are on the server where Bookstack is hosted.
My instance is running on a CentOS server vith Ngnix webserver installed.
For the images, this is variable as no images are displayed on the PDF export, whatever how large they are.

@Dav31 commented on GitHub (May 29, 2017): Hi Dan, No problem for the late. Yes, the images are on the server where Bookstack is hosted. My instance is running on a CentOS server vith Ngnix webserver installed. For the images, this is variable as no images are displayed on the PDF export, whatever how large they are.
Author
Owner

@the4ndy commented on GitHub (May 31, 2017):

I am also experiencing this issue....i have been since starting using Book Stack almost 1 year ago....i, until recently, thought this was just the natural behavior of the PDF export feature (and was actually coming here to request that feature be added).

I am running the latest version of book stack (just updated today) 0.16.2. I am running it on Ubuntu 16.04 (up to date) with an Nginx webserver
php --version = 7.0.18
mysql --version = 14.14 distrib 5.7.18

@the4ndy commented on GitHub (May 31, 2017): I am also experiencing this issue....i have been since starting using Book Stack almost 1 year ago....i, until recently, thought this was just the natural behavior of the PDF export feature (and was actually coming here to request that feature be added). I am running the latest version of book stack (just updated today) 0.16.2. I am running it on Ubuntu 16.04 (up to date) with an Nginx webserver php --version = 7.0.18 mysql --version = 14.14 distrib 5.7.18
Author
Owner

@vladime commented on GitHub (Aug 4, 2017):

Same issue here... Running as a docker container.
Ubuntu 16.04
Docker 17.06.0-ce
Nginx
mysql 5.7.12

@vladime commented on GitHub (Aug 4, 2017): Same issue here... Running as a docker container. Ubuntu 16.04 Docker 17.06.0-ce Nginx mysql 5.7.12
Author
Owner

@Alwaysin commented on GitHub (Aug 4, 2017):

Same here!

Debian 9
PHP 7.0.19-1
10.1.23-MariaDB-9+deb9u1
apache2 2.4.25-3+deb9u2

@Alwaysin commented on GitHub (Aug 4, 2017): Same here! Debian 9 PHP 7.0.19-1 10.1.23-MariaDB-9+deb9u1 apache2 2.4.25-3+deb9u2
Author
Owner

@pabloalbrecht commented on GitHub (Aug 5, 2017):

Same here... also if you export to HTML
Debian 14, Debian 16
PHP 7 / Nginx

@pabloalbrecht commented on GitHub (Aug 5, 2017): Same here... also if you export to HTML Debian 14, Debian 16 PHP 7 / Nginx
Author
Owner

@ssddanbrown commented on GitHub (Aug 6, 2017):

Hi @vladime, Are you using the popular solidnerd/docker-bookstack setup for docker or a different setup? A docker setup with this issue would be ideal for me to try to replicate the issue.

@ssddanbrown commented on GitHub (Aug 6, 2017): Hi @vladime, Are you using the popular solidnerd/docker-bookstack setup for docker or a different setup? A docker setup with this issue would be ideal for me to try to replicate the issue.
Author
Owner

@vladime commented on GitHub (Aug 6, 2017):

Hi Dan, yes, I am using solidnerd docker with BS 0.17.1. One detail which is might be important: I am using Ngnix, so the whole path looks like this domain.com/wiki/restofthebookstackpath/

On 6. Aug 2017, at 14:29, Dan Brown notifications@github.com wrote:

Hi @vladime, Are you using the popular solidnerd/docker-bookstack setup for docker or a different setup? A docker setup with this issue would be ideal for me to try to replicate the issue.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@vladime commented on GitHub (Aug 6, 2017): Hi Dan, yes, I am using solidnerd docker with BS 0.17.1. One detail which is might be important: I am using Ngnix, so the whole path looks like this domain.com/wiki/restofthebookstackpath/ > On 6. Aug 2017, at 14:29, Dan Brown <notifications@github.com> wrote: > > Hi @vladime, Are you using the popular solidnerd/docker-bookstack setup for docker or a different setup? A docker setup with this issue would be ideal for me to try to replicate the issue. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub, or mute the thread. >
Author
Owner

@julienmmm commented on GitHub (Aug 21, 2017):

Hello,

I am also facing the same issue with the pdf exporter (Install on Fedora 25).

Also note that I have the same issue with the "Web contained file" exporter.

@julienmmm commented on GitHub (Aug 21, 2017): Hello, I am also facing the same issue with the pdf exporter (Install on Fedora 25). Also note that I have the same issue with the "Web contained file" exporter.
Author
Owner

@Dav31 commented on GitHub (Sep 7, 2017):

Hello,

I just updated to 0.17.4 version.
The issue still occurs.
It seems to be directly linked to NGinx.

Regards.

@Dav31 commented on GitHub (Sep 7, 2017): Hello, I just updated to 0.17.4 version. The issue still occurs. It seems to be directly linked to NGinx. Regards.
Author
Owner

@jacksonp2008 commented on GitHub (Sep 8, 2017):

Yes, must be NGINX related. I see this on behavior on a system that is using NGINX, but it works fine on the latest docker container without NGINX.

@jacksonp2008 commented on GitHub (Sep 8, 2017): Yes, must be NGINX related. I see this on behavior on a system that is using NGINX, but it works fine on the latest docker container without NGINX.
Author
Owner

@nblenkhorn commented on GitHub (Sep 11, 2017):

I am also seeing this behaviour on Apache. I'm using v0.17.4 as well.

@nblenkhorn commented on GitHub (Sep 11, 2017): I am also seeing this behaviour on Apache. I'm using v0.17.4 as well.
Author
Owner

@megamorf commented on GitHub (Sep 12, 2017):

I'm also seeing this issue, running https://github.com/solidnerd/docker-bookstack behind Traefik as SSL terminating reverse proxy.

@megamorf commented on GitHub (Sep 12, 2017): I'm also seeing this issue, running https://github.com/solidnerd/docker-bookstack behind Traefik as SSL terminating reverse proxy.
Author
Owner

@ssddanbrown commented on GitHub (Sep 23, 2017):

Hey everyone, Can someone (That has this issue) please confirm if the 'Contained HTML File' export works for them with images?

Need to know if the issue is in the document creation or PDF rendering code...

@ssddanbrown commented on GitHub (Sep 23, 2017): Hey everyone, Can someone (That has this issue) please confirm if the 'Contained HTML File' export works for them with images? Need to know if the issue is in the document creation or PDF rendering code...
Author
Owner

@julienmmm commented on GitHub (Sep 23, 2017):

Hello,

I am facing the same issue with the self contained html export.

Julien

Le 23 sept. 2017 10:56, "Dan Brown" notifications@github.com a écrit :

Hey everyone, Can someone (That has this issue) please confirm if the
'Contained HTML File' export works for them with images?

Need to know if the issue is in the document creation or PDF rendering
code...


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/BookStackApp/BookStack/issues/392#issuecomment-331621108,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AXg9t7S7ZoXDttVjkLBfUpUhwXcTAq7-ks5slMeqgaJpZM4NX9PJ
.

@julienmmm commented on GitHub (Sep 23, 2017): Hello, I am facing the same issue with the self contained html export. Julien Le 23 sept. 2017 10:56, "Dan Brown" <notifications@github.com> a écrit : > Hey everyone, Can someone (That has this issue) please confirm if the > 'Contained HTML File' export works for them with images? > > Need to know if the issue is in the document creation or PDF rendering > code... > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/BookStackApp/BookStack/issues/392#issuecomment-331621108>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AXg9t7S7ZoXDttVjkLBfUpUhwXcTAq7-ks5slMeqgaJpZM4NX9PJ> > . >
Author
Owner

@megamorf commented on GitHub (Sep 24, 2017):

Can confirm, images are also missing with the html export.

@megamorf commented on GitHub (Sep 24, 2017): Can confirm, images are also missing with the html export.
Author
Owner

@Dav31 commented on GitHub (Sep 25, 2017):

Hi Dan,

I can confirm this too.
The HTML export doesn't provide us the images.

David

@Dav31 commented on GitHub (Sep 25, 2017): Hi Dan, I can confirm this too. The HTML export doesn't provide us the images. David
Author
Owner

@ssddanbrown commented on GitHub (Oct 6, 2017):

Hi all, I've just deployed version v0.18.3 to specifically target this issue. I have an idea at what the problem could be but I'm not sure until it's tested by a few different people but hopefully this patch will get things working.

I did test this in a local dev container setup where images did not work before but there may be a different issue at play here.

Please let me know how it goes after updating.

@ssddanbrown commented on GitHub (Oct 6, 2017): Hi all, I've just deployed version v0.18.3 to specifically target this issue. I have an idea at what the problem could be but I'm not sure until it's tested by a few different people but hopefully this patch will get things working. I did test this in a local dev container setup where images did not work before but there may be a different issue at play here. Please let me know how it goes after updating.
Author
Owner

@megamorf commented on GitHub (Oct 7, 2017):

@ssddanbrown Nice, I'm going to test this tomorrow and let you know 👍

@megamorf commented on GitHub (Oct 7, 2017): @ssddanbrown Nice, I'm going to test this tomorrow and let you know 👍
Author
Owner

@megamorf commented on GitHub (Oct 7, 2017):

@ssddanbrown Getting a Whoops, looks like something went wrong. error when replacing ExportService.php with your version. The error log only shows a 500 error for the GET /books/playground/page/new-page/export/pdf request.

I hope some other folks can chime in as the addition of docker with a reverse proxy certainly increases complexity.

@megamorf commented on GitHub (Oct 7, 2017): @ssddanbrown Getting a `Whoops, looks like something went wrong.` error when replacing ExportService.php with your version. The error log only shows a 500 error for the `GET /books/playground/page/new-page/export/pdf` request. I hope some other folks can chime in as the addition of docker with a reverse proxy certainly increases complexity.
Author
Owner

@Alwaysin commented on GitHub (Oct 8, 2017):

It works for me, but I think a previous release already fixed it.

@Alwaysin commented on GitHub (Oct 8, 2017): It works for me, but I think a previous release already fixed it.
Author
Owner

@julienmmm commented on GitHub (Oct 9, 2017):

Hello,

After the upgrade to the latest version, all the images in all the documents appear as Broken link images:
image

But after editing the page and re-uploaded the images, they were correctly displayed and exported in the PDF.

Regarding the upload of images, I've been forced to upload them via the "insert image" button while I was used to do a copy/paste from a screenshot tool before. Now the copy paste does not work and BookStack displays a general error message when trying to upload images this way.
image

But I suppose it can be the subject of another issue.

@julienmmm commented on GitHub (Oct 9, 2017): Hello, After the upgrade to the latest version, all the images in all the documents appear as Broken link images: ![image](https://user-images.githubusercontent.com/24657335/31326350-a31f9320-acc6-11e7-9033-4f41672ce104.png) But after editing the page and re-uploaded the images, they were correctly displayed and exported in the PDF. Regarding the upload of images, I've been forced to upload them via the "insert image" button while I was used to do a copy/paste from a screenshot tool before. Now the copy paste does not work and BookStack displays a general error message when trying to upload images this way. ![image](https://user-images.githubusercontent.com/24657335/31326693-ce738ab0-acc9-11e7-8b02-8d7a1ef20b4b.png) But I suppose it can be the subject of another issue.
Author
Owner

@Dav31 commented on GitHub (Oct 13, 2017):

Hi Dan,

I just updated my BookStack installation, and the PDF export runs just fine now.
Thank you very much for your support.

David

@Dav31 commented on GitHub (Oct 13, 2017): Hi Dan, I just updated my BookStack installation, and the PDF export runs just fine now. Thank you very much for your support. David
Author
Owner

@aljawaid commented on GitHub (Nov 26, 2017):

Hello I had the same problem on 0.18.0. I updated to 0.18.5 and the export to pdf now works but as per below:

  • you must use uploaded images only
  • ctrl+c results in an unknown error, so it doesn't work anymore.
  • existing images wont work
@aljawaid commented on GitHub (Nov 26, 2017): Hello I had the same problem on 0.18.0. I updated to 0.18.5 and the export to pdf **now works but as per below:** - you must use uploaded images only - ctrl+c results in an unknown error, so it doesn't work anymore. - existing images wont work
Author
Owner

@aljawaid commented on GitHub (Nov 29, 2017):

Hello,

The only problem now is that the image does not stay (on pdf) in the position it is meant to.

@aljawaid commented on GitHub (Nov 29, 2017): Hello, The only problem now is that the image does not stay (on pdf) in the position it is meant to.
Author
Owner

@adrie-tc commented on GitHub (Jan 18, 2018):

I am faced with image issues as well, using the export to PDF function.
It produces results as shown by @julienmmm having broken images.
These are with freshly uloaded images however.
Using docker and a reverse proxy (nginx).
The issue (or rather solution) is still unresolved i take it?

@adrie-tc commented on GitHub (Jan 18, 2018): I am faced with image issues as well, using the export to PDF function. It produces results as shown by @julienmmm having broken images. These are with freshly uloaded images however. Using docker and a reverse proxy (nginx). The issue (or rather solution) is still unresolved i take it?
Author
Owner

@adrie-tc commented on GitHub (Feb 20, 2018):

FYI, beta release v0.20.0 seems to have fixed it.
Testing a random sample of PDF exports containing media does not show any issues regarding images anymore.

@adrie-tc commented on GitHub (Feb 20, 2018): FYI, [beta release v0.20.0](https://www.bookstackapp.com/blog/beta-release-v0-20-0/) seems to have fixed it. Testing a random sample of PDF exports containing media does not show any issues regarding images anymore.
Author
Owner

@ssddanbrown commented on GitHub (Mar 5, 2018):

Happy to hear this has been resolved for a good number of instances. Still looks like we're getting bugs though so I'll keep his open for continued discussions.

@ssddanbrown commented on GitHub (Mar 5, 2018): Happy to hear this has been resolved for a good number of instances. Still looks like we're getting bugs though so I'll keep his open for continued discussions.
Author
Owner

@adrie-tc commented on GitHub (Mar 6, 2018):

I noticed the images coming from the new draw.io integration do not show up in the pdfs.
Instead they get replaced by a crossed out block image.

Normal view and HTML export are fine ofcourse.

@adrie-tc commented on GitHub (Mar 6, 2018): I noticed the images coming from the new draw.io integration do not show up in the pdfs. Instead they get replaced by a crossed out block image. Normal view and HTML export are fine ofcourse.
Author
Owner

@ghost commented on GitHub (Apr 5, 2018):

Hi, will this work if images are secure, i mean by using the "local_secure_setting"?

@ghost commented on GitHub (Apr 5, 2018): Hi, will this work if images are secure, i mean by using the "local_secure_setting"?
Author
Owner

@alexmannuk commented on GitHub (Aug 24, 2020):

Appears to be fixed in all recent versions on both Apache and Nginx, no updates to the issue since 2018 so can likely be closed.

@alexmannuk commented on GitHub (Aug 24, 2020): Appears to be fixed in all recent versions on both Apache and Nginx, no updates to the issue since 2018 so can likely be closed.
Author
Owner

@ssddanbrown commented on GitHub (May 4, 2021):

Thanks @alexmannuk.

I'll close this off since the original issue creator expressed that their issue has been since solved.

@ssddanbrown commented on GitHub (May 4, 2021): Thanks @alexmannuk. I'll close this off since the original issue creator expressed that their issue has been since solved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#332