2 title = "PDF Rendering"
3 description = "Options to configure PDF rendering within BookStack"
8 By default BookStack uses [dompdf](https://github.com/dompdf/dompdf) to export pages as PDF documents. The benefit of using dompdf is that it doesn't require any additional installation or setup but the rendering capabilities are somewhat limited.
10 As an alternative you can use [wkhtmltopdf](http://wkhtmltopdf.org/) to generate PDF documents instead. wkhtmltopdf uses the Qt WebKit rendering engine to provide a more accurate overall result, but comes with additional security concerns to be aware of.
14 Pre-compiled binaries for wkhtmltopdf can be found on the downloads page of [their website](http://wkhtmltopdf.org/downloads.html).
15 BookStack will check for a file named `wkhtmltopdf` at the base folder of a BookStack install. If found it will use that to render PDF exports.
16 If that does not exist it will check for a `WKHTMLTOPDF` variable in the `.env` file.
17 You can use the below variable in your `.env` file to set an alternate location to wkhtmltopdf:
20 WKHTMLTOPDF=/home/user/bins/wkhtmltopdf
23 If neither of those exist, or if the below mentioned security option is not enabled, the default dompdf renderer will be used instead.
25 **Note:** As of BookStack v21.08 the `ALLOW_UNTRUSTED_SERVER_FETCHING` must also be set to `true` for wkhtmltopdf to be enabled, without this dompdf will be used instead.
26 This change was made for security since, in many cases, wkhtmltopdf will perform fetches to external URLs which may be defined by users.
27 You should only enable the below option in environments where users & visitors are trusted.
30 ALLOW_UNTRUSTED_SERVER_FETCHING=true
33 [See our security page for more detail regarding this option](/docs/admin/security/#server-side-requests).
37 By default PDF exports are generated at an A4 size. If you'd prefer exports to be generated at "US Letter" standard sizes
38 you can specify this within your `.env` like so:
42 EXPORT_PAGE_SIZE=letter