feat: split pdf into small chunks by pdfbox by intelliking ยท Pull Request #5718 ยท Stirling-Tools/Stirling-PDF

Conversation

@intelliking

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 PosterPdfController using pure Java/PDFBox implementation
  • Removed external process execution: No more ProcessBuilder or 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

Testing (if applicable)

  • I have tested my changes locally. Refer to the Testing Guide for more details.

@stirlingbot stirlingbot bot added Java

Pull requests that update Java code

Front End

Issues or pull requests related to front-end development

Back End

Issues related to back-end development

Translation API

API-related issues or pull requests

labels

Feb 13, 2026

@stirlingbot

๐ŸŒ TOML Translation Verification Summary

๐Ÿ”„ Reference Branch: pr-branch

๐Ÿ“ƒ File Check: en-GB/translation.toml

  1. Test Status: โœ… Passed
  2. Test Status: โœ… Passed
  3. Test Status: โœ… Passed

โœ… Overall Check Status: Success

Thanks @intelliking for your help in keeping the translations up to date.

@intelliking

@Frooodle

@intelliking

Hi, @Frooodle Can you check my PR again? Thank you.

@intelliking

1 similar comment

@intelliking

@Frooodle

@stirlingbot

๐Ÿš€ 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.

@ConnorYoh

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?

@intelliking

@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.

@intelliking

@Frooodle

@stirlingbot

๐Ÿš€ 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.

Reviewers

@reecebrowne reecebrowne Awaiting requested review from reecebrowne reecebrowne is a code owner

@ConnorYoh ConnorYoh Awaiting requested review from ConnorYoh ConnorYoh is a code owner

@EthanHealy01 EthanHealy01 Awaiting requested review from EthanHealy01 EthanHealy01 is a code owner

@jbrunton96 jbrunton96 Awaiting requested review from jbrunton96 jbrunton96 is a code owner

@Frooodle Frooodle Awaiting requested review from Frooodle Frooodle is a code owner

@Ludy87 Ludy87 Awaiting requested review from Ludy87 Ludy87 is a code owner

At least 2 approving reviews are required to merge this pull request.

Labels

API

API-related issues or pull requests

Back End

Issues related to back-end development

enhancement

New feature or request

Front End

Issues or pull requests related to front-end development

Java

Pull requests that update Java code

pr-deployed

Pull request has been deployed to a test environment

size:L

This PR changes 100-499 lines ignoring generated files.

Translation