[PR #4969] [MERGED] PDF Exports: New command option and library/option cleanup #6427

Closed
opened 2026-02-05 10:32:00 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/4969
Author: @ssddanbrown
Created: 4/22/2024
Status: Merged
Merged: 4/26/2024
Merged by: @ssddanbrown

Base: developmentHead: pdf_command_option


📝 Commits (4)

  • bb6670d PDF: Started new command option, merged options, simplified dompdf
  • 4020085 PDF: Removed barryvdh snappy to use snappy direct
  • 1c7128c PDF: Added implmentation of command PDF option
  • f0dd33c PDF: Added tests for pdf command, fixed old tests for changes

📊 Changes

12 files changed (+211 additions, -246 deletions)

View changed files

📝 .env.example.complete (+8 -0)
📝 app/Config/app.php (+0 -2)
📝 app/Config/exports.php (+27 -15)
app/Config/snappy.php (+0 -34)
📝 app/Entities/Tools/PdfGenerator.php (+106 -12)
app/Exceptions/PdfExportException.php (+7 -0)
📝 composer.json (+2 -2)
📝 composer.lock (+14 -169)
📝 phpunit.xml (+1 -0)
📝 readme.md (+1 -2)
📝 tests/Entity/ExportTest.php (+37 -2)
📝 tests/Unit/ConfigTest.php (+8 -8)

📄 Description

Implementation from thoughts/ideas of #4732.
Also simplifies/organises config for exports, and removes some intermediate dependencies.

References

Todo

  • Review unwrapping snappyPDF like DomPDF.
  • Update existing snappy code to support new options format.
  • Complete implementation for new command option.
  • Testing:
    • Cover new command option.
    • Ensure DomPDF export still works and uses app options.
    • Ensure WKHTMLtoPDF export still works and uses app options.
    • Manual test of command option on Windows.

Docs Updates

  • Document new command option, along with example.
  • Update old WKHTMLtoPDF option to indicate deprecation.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/4969 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 4/22/2024 **Status:** ✅ Merged **Merged:** 4/26/2024 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `development` ← **Head:** `pdf_command_option` --- ### 📝 Commits (4) - [`bb6670d`](https://github.com/BookStackApp/BookStack/commit/bb6670d395180f8a81bcbfd92da1896fcfb18d34) PDF: Started new command option, merged options, simplified dompdf - [`4020085`](https://github.com/BookStackApp/BookStack/commit/40200856af366f735283da4cc1b28519ddb3586b) PDF: Removed barryvdh snappy to use snappy direct - [`1c7128c`](https://github.com/BookStackApp/BookStack/commit/1c7128c2cb08271aa456951f6d6b4ce930df5cb5) PDF: Added implmentation of command PDF option - [`f0dd33c`](https://github.com/BookStackApp/BookStack/commit/f0dd33c1b47a1ae26c58e0d32ef824d2635efeb0) PDF: Added tests for pdf command, fixed old tests for changes ### 📊 Changes **12 files changed** (+211 additions, -246 deletions) <details> <summary>View changed files</summary> 📝 `.env.example.complete` (+8 -0) 📝 `app/Config/app.php` (+0 -2) 📝 `app/Config/exports.php` (+27 -15) ➖ `app/Config/snappy.php` (+0 -34) 📝 `app/Entities/Tools/PdfGenerator.php` (+106 -12) ➕ `app/Exceptions/PdfExportException.php` (+7 -0) 📝 `composer.json` (+2 -2) 📝 `composer.lock` (+14 -169) 📝 `phpunit.xml` (+1 -0) 📝 `readme.md` (+1 -2) 📝 `tests/Entity/ExportTest.php` (+37 -2) 📝 `tests/Unit/ConfigTest.php` (+8 -8) </details> ### 📄 Description Implementation from thoughts/ideas of #4732. Also simplifies/organises config for exports, and removes some intermediate dependencies. ### References - Symfony process docs: https://symfony.com/doc/current/components/process.html#usage - Relevant parts regarding command parsing and dynamic var usage: https://github.com/symfony/symfony/blob/7.0/src/Symfony/Component/Process/Process.php#L169-L190 ### Todo - [x] Review unwrapping snappyPDF like DomPDF. - [x] Update existing snappy code to support new options format. - [x] Complete implementation for new command option. - Testing: - [x] Cover new command option. - [x] Ensure DomPDF export still works and uses app options. - [x] Ensure WKHTMLtoPDF export still works and uses app options. - [x] Manual test of command option on Windows. ### Docs Updates - Document new command option, along with example. - Update old WKHTMLtoPDF option to indicate deprecation. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:32:00 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6427