feat: split pdf into small chunks by pdfbox by intelliking ยท Pull Request #5718 ยท Stirling-Tools/Stirling-PDF
Conversation
Refactor: Replace mutool with PDFBox for Poster PDF Splitting
Summary
Refactored the "Split for Poster Print" feature to use Apache PDFBox instead of mutool, eliminating the external binary dependency while maintaining full functionality and improving code maintainability.
Changes
Improved from PR 5682
Backend Refactoring
- Replaced mutool with PDFBox: Complete rewrite of
PosterPdfControllerusing pure Java/PDFBox implementation - Removed external process execution: No more
ProcessBuilderor shell command execution - Vector graphics preserved: Content remains vector-based (no rasterization)
- Page normalization: Implemented CropBox-to-MediaBox normalization for consistent coordinate space handling
- Improved CropBox handling: Properly handles PDFs with non-zero CropBox origins and two-page spreads
Closes #5644
Checklist
General
- I have read the Contribution Guidelines
- I have read the Stirling-PDF Developer Guide (if applicable)
- I have read the How to add new languages to Stirling-PDF (if applicable)
- I have performed a self-review of my own code
- My changes generate no new warnings
Testing (if applicable)
- I have tested my changes locally. Refer to the Testing Guide for more details.
stirlingbot
bot
added
Java
labels
Feb 13, 2026๐ TOML Translation Verification Summary
๐ Reference Branch: pr-branch
๐ File Check: en-GB/translation.toml
- Test Status: โ Passed
- Test Status: โ Passed
- Test Status: โ Passed
โ Overall Check Status: Success
Thanks @intelliking for your help in keeping the translations up to date.
Hi, @Frooodle Can you check my PR again? Thank you.
๐ PR Test Deployment
Your PR has been deployed for testing!
๐ Test URL: http://23.22.230.180:5718
Security Disabled
This deployment will be automatically cleaned up when the PR is closed.
This is a very similar tool to split-pdf-by-sections. Would it make sense to combine the tools in the frontend so that the user can select if they want to split the file into multiple files or keep it as a single file? Can the same endpoint be used for both tools?
@ConnorYoh Thanks for your review. As you mentioned these two tools are similar. The differences are multiple/single file option and unlike split-pdf-by-sections, new tool can split pages into regular paper size like A4 for print purpose. In my opinion, they shouldn't be combined. While they both divide pages, the user intent is different. In addition, the underlying PDF manipulation is different enough that combining them would require significant refactoring.
๐ PR Test Deployment
Your PR has been deployed for testing!
๐ Test URL: http://23.22.230.180:5718
Security Disabled
This deployment will be automatically cleaned up when the PR is closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters