Ability to manage pdf export zoom/page size #3754

Open
opened 2026-02-05 07:20:09 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @eoli3n on GitHub (Apr 20, 2023).

Describe the feature you'd like

I want more information per pages when exporting as pdf/html, the default zoom is huge.

Describe the benefits this would bring to existing BookStack users

Less pages to print, less paper, less cutted tree, amazonia saved, more oxygen on the planet = more happiness :)

Can the goal of this request already be achieved via other means?

Kind of, yes : export as html, print a pdf with 70% zoom. But it change how it looks.

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundemental request

How long have you been using BookStack?

0 to 6 months

Additional context

No response

Originally created by @eoli3n on GitHub (Apr 20, 2023). ### Describe the feature you'd like I want more information per pages when exporting as pdf/html, the default zoom is huge. ### Describe the benefits this would bring to existing BookStack users Less pages to print, less paper, less cutted tree, amazonia saved, more oxygen on the planet = more happiness :) ### Can the goal of this request already be achieved via other means? Kind of, yes : export as html, print a pdf with 70% zoom. But it change how it looks. ### Have you searched for an existing open/closed issue? - [X] I have searched for existing issues and none cover my fundemental request ### How long have you been using BookStack? 0 to 6 months ### Additional context _No response_
OVERLORD added the 🔨 Feature Request🚚 Export System labels 2026-02-05 07:20:09 +03:00
Author
Owner

@eoli3n commented on GitHub (Sep 16, 2023):

Nothing planned ?

@eoli3n commented on GitHub (Sep 16, 2023): Nothing planned ?
Author
Owner

@ssddanbrown commented on GitHub (Sep 16, 2023):

@eoli3n Not right now, there's been no other demand for this, so not really something I'd look to add an option for.

I could probably provide logical theme system hack to alter this globally if desired, Just need to know if you're using the default PDF renderer or if you've set settings to use WKHTMLTOPDF.

@ssddanbrown commented on GitHub (Sep 16, 2023): @eoli3n Not right now, there's been no other demand for this, so not really something I'd look to add an option for. I could probably provide [logical theme system hack](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/logical-theme-system.md) to alter this globally if desired, Just need to know if you're using the default PDF renderer or if you've set settings to use WKHTMLTOPDF.
Author
Owner

@eoli3n commented on GitHub (Sep 16, 2023):

A hack would be perfect if possible, with dompdf

@eoli3n commented on GitHub (Sep 16, 2023): A hack would be perfect if possible, with dompdf
Author
Owner

@ssddanbrown commented on GitHub (Sep 16, 2023):

Here's an unofficial hack, can't assure it'll be issue free. It's fairly simple though so should rarely cause issues with future changes (not impossible though). Add this to your functions.php after going the "Getting Started" part of the logical theme system docs/video.

<?php

use BookStack\Facades\Theme;
use BookStack\Theming\ThemeEvents;

Theme::listen(ThemeEvents::APP_BOOT, function () {
    config()->set('dompdf.options.dpi', 144);
});

Adjust the 144 as needed (default is 96).
If things look a little "contained" (with large side margins), you can add the below to the "Custom HTML Head Content" customization setting within the BookStack UI:

<style>
.export-format-pdf .page-content { max-width: 100%; }
</style>
@ssddanbrown commented on GitHub (Sep 16, 2023): Here's an unofficial hack, can't assure it'll be issue free. It's fairly simple though so should rarely cause issues with future changes (not impossible though). Add this to your `functions.php` after going the "Getting Started" part of the [logical theme system docs/video](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/logical-theme-system.md). ```php <?php use BookStack\Facades\Theme; use BookStack\Theming\ThemeEvents; Theme::listen(ThemeEvents::APP_BOOT, function () { config()->set('dompdf.options.dpi', 144); }); ``` Adjust the `144` as needed (default is 96). If things look a little "contained" (with large side margins), you can add the below to the "Custom HTML Head Content" customization setting within the BookStack UI: ```html <style> .export-format-pdf .page-content { max-width: 100%; } </style> ```
Author
Owner

@eoli3n commented on GitHub (Sep 26, 2024):

Does this still work with recent pdf export changes ?
IMO the default export size is WAY to big.

@eoli3n commented on GitHub (Sep 26, 2024): Does this still work with recent pdf export changes ? IMO the default export size is WAY to big.
Author
Owner

@ssddanbrown commented on GitHub (Sep 26, 2024):

@eoli3n I have not tested this, but the setting has moved for the current version of BookStack, and the functions.php should probably now be:

<?php

use BookStack\Facades\Theme;
use BookStack\Theming\ThemeEvents;

Theme::listen(ThemeEvents::APP_BOOT, function () {
    config()->set('exports.dompdf.dpi', 144);
});
@ssddanbrown commented on GitHub (Sep 26, 2024): @eoli3n I have not tested this, but the setting has moved for the current version of BookStack, and the `functions.php` should probably now be: ```php <?php use BookStack\Facades\Theme; use BookStack\Theming\ThemeEvents; Theme::listen(ThemeEvents::APP_BOOT, function () { config()->set('exports.dompdf.dpi', 144); }); ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3754