Check PDF font loading locations for permission issues #886

Closed
opened 2026-02-04 22:44:01 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @Biepa on GitHub (Oct 29, 2018).

Describe the bug
When trying to export a page as PDF, I get the "An unknown error occurred" message.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Open a page
  2. Export as PDF
    May be a local provlem

Expected behavior
HTML export is possible.
PDF also doesn't work, when i try to export an empty page
Screenshots

Your Configuration (please complete the following information):

  • Bookstack: v0.24.1
  • PHP 7.1.23
  • Hosting Method: Docker

Additional context
Tried the steps in #804

docker log:
[Mon Oct 29 11:43:03.564212 2018] [php7:notice] [pid 95] [client 172.18.0.5:34506] [2018-10-29 11:43:03] production.ERROR: fopen(/var/www/bookstack/app/vendor/dompdf/dompdf/lib /fonts//89131987572cd9c617502fd297a45e59.ufm): failed to open stream: No such file or directory {"userId":1,"email":"somemail@gmail.com","exception":"[object] (ErrorException(code: 0): fope n(/var/www/bookstack/app/vendor/dompdf/dompdf/lib/fonts//89131987572cd9c617502fd297a45e59.ufm): failed to open stream: No such file or directory at /var/www/bookstack/vendor/phenx/php-font-li b/src/FontLib/AdobeFontMetrics.php:45)"} [], referer: https://somedomain.com/books/how-tos/page/bitwarden

Originally created by @Biepa on GitHub (Oct 29, 2018). **Describe the bug** When trying to export a page as PDF, I get the "An unknown error occurred" message. **Steps To Reproduce** Steps to reproduce the behavior: 1. Open a page 2. Export as PDF May be a local provlem **Expected behavior** HTML export is possible. PDF also doesn't work, when i try to export an empty page **Screenshots** **Your Configuration (please complete the following information):** - Bookstack: v0.24.1 - PHP 7.1.23 - Hosting Method: Docker **Additional context** Tried the steps in #804 docker log: `[Mon Oct 29 11:43:03.564212 2018] [php7:notice] [pid 95] [client 172.18.0.5:34506] [2018-10-29 11:43:03] production.ERROR: fopen(/var/www/bookstack/app/vendor/dompdf/dompdf/lib /fonts//89131987572cd9c617502fd297a45e59.ufm): failed to open stream: No such file or directory {"userId":1,"email":"somemail@gmail.com","exception":"[object] (ErrorException(code: 0): fope n(/var/www/bookstack/app/vendor/dompdf/dompdf/lib/fonts//89131987572cd9c617502fd297a45e59.ufm): failed to open stream: No such file or directory at /var/www/bookstack/vendor/phenx/php-font-li b/src/FontLib/AdobeFontMetrics.php:45)"} [], referer: https://somedomain.com/books/how-tos/page/bitwarden`
OVERLORD added the 🏭 Back-End🔍 Pending Validation labels 2026-02-04 22:44:01 +03:00
Author
Owner

@Biepa commented on GitHub (Feb 6, 2019):

@ssddanbrown Is there something we can do?

@Biepa commented on GitHub (Feb 6, 2019): @ssddanbrown Is there something we can do?
Author
Owner

@Biepa commented on GitHub (Feb 21, 2019):

It works, when i remove this...

`

<style> body, button, input, select, label, textarea { font-family: 'Ubuntu', sans-serif; } .Codemirror, pre, #markdown-editor-input, .editor-toolbar, .code-base { font-family: monospace; } </style>`

from my Custom HTML.

Maybe that helps.

@Biepa commented on GitHub (Feb 21, 2019): It works, when i remove this... `<link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet"> <style> body, button, input, select, label, textarea { font-family: 'Ubuntu', sans-serif; } .Codemirror, pre, #markdown-editor-input, .editor-toolbar, .code-base { font-family: monospace; } </style>` from my Custom HTML. Maybe that helps.
Author
Owner

@kidox commented on GitHub (Mar 28, 2019):

It's a problem with dompdf library when importing custom fonts as style.

To fix this go to edit config/dompdf.php file and set the paths like following:

dompdf_export_fix

After changing it execute the following command:

php artisan config:cache

This should fix the problem.

@kidox commented on GitHub (Mar 28, 2019): It's a problem with dompdf library when importing custom fonts as style. To fix this go to edit *config/dompdf.php* file and set the paths like following: ![dompdf_export_fix](https://user-images.githubusercontent.com/5457704/55165872-70122300-516e-11e9-93c5-cfbace8878ef.png) After changing it execute the following command: ``` php artisan config:cache ``` This should fix the problem.
Author
Owner

@Biepa commented on GitHub (Mar 28, 2019):

@kidox Worked perfectly.
I'm using the docker image, so I guess I have to make this change persistent.

Thanks a lot.

@Biepa commented on GitHub (Mar 28, 2019): @kidox Worked perfectly. I'm using the docker image, so I guess I have to make this change persistent. Thanks a lot.
Author
Owner

@ssddanbrown commented on GitHub (Jun 13, 2022):

Fairly sure we addressed this a few releases back so I'll therefore close this off.

@ssddanbrown commented on GitHub (Jun 13, 2022): Fairly sure we addressed this a few releases back so I'll therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#886