+As an alternative you can instead define a command to make use of external PDF rendering options that may provide more capabilities.
+
+{{<toc>}}
+
+### Export Page Size
+
+By default PDF exports are generated at an A4 size. If you'd prefer exports to be generated at "US Letter" standard sizes
+you can specify this within your `.env` like so:
+
+```bash
+# US Letter
+EXPORT_PAGE_SIZE=letter
+```
+
+### PDF Export Command
+
+Instead of using the default PHP-based default PDF rendering system, you can define a command for BookStack to use when generating
+a PDF. This enables flexibility in what program is used to create PDF exports.
+The command is set via a `EXPORT_PDF_COMMAND` option in your `.env` file, which can use the following placeholders:
+
+- `{input_html_path}` - Path to a file where BookStack will provide HTML to convert.
+- `{output_pdf_path}` - Path to a file where the command should output its PDF result.
+
+Here's an example value for this option using these placeholders:
+
+```bash
+EXPORT_PDF_COMMAND="/scripts/convert.sh {input_html_path} {output_pdf_path}"
+```
+
+Below you can find some examples using this for specific PDF generation options.
+
+**Considerations**
+
+- Security is a significant concern for this option and process. Input HTML will include user-editable data, and is not assured to be trustworthy & safe. Ideally, any networking or filesystem access would be disabled/prevented during conversion.
+- BookStack will attempt to embed required images into the HTML data as base64 data URIs to avoid external fetching.
+- BookStack will embed CSS styling into the HTML data.
+- Use of this option requires running a process from PHP, which can be considered risky and may potentially be blocked by configuration, environment and/or systems like SELinux by default.
+- BookStack sets a timeout of 15 seconds for this command to return.
+- BookStack will use the return status code of the command as an indicator of failure/success, while also checking that the output PDF was written to.
+
+#### Example: Weasyprint Command Option
+
+**Warning:** This is option is not considered secure due to potential filesystem/network access.
+
+This option uses [weasyprint](https://doc.courtbouillon.org/weasyprint/stable/) to generate PDF exports.
+
+```bash
+EXPORT_PDF_COMMAND="weasyprint {input_html_path} {output_pdf_path}"
+```