Skip to content

Comments

feat: split pdf into small chunks by pdfbox#5718

Open
intelliking wants to merge 3 commits intoStirling-Tools:mainfrom
intelliking:feat-split-pdf-into-small-chunks
Open

feat: split pdf into small chunks by pdfbox#5718
intelliking wants to merge 3 commits intoStirling-Tools:mainfrom
intelliking:feat-split-pdf-into-small-chunks

Conversation

@intelliking
Copy link

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.

@dosubot dosubot bot added size:L This PR changes 100-499 lines ignoring generated files. enhancement New feature or request labels Feb 13, 2026
@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
Copy link
Contributor

stirlingbot bot commented Feb 13, 2026

🌐 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
Copy link
Author

@Frooodle Please review my PR. Thanks.

@Frooodle
Copy link
Member

/deploypr

@intelliking
Copy link
Author

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

@intelliking
Copy link
Author

@Frooodle Please review my PR. Thanks.

1 similar comment
@intelliking
Copy link
Author

@Frooodle Please review my PR. Thanks.

@Frooodle
Copy link
Member

/deploypr

@stirlingbot stirlingbot bot added the pr-deployed Pull request has been deployed to a test environment label Feb 19, 2026
@stirlingbot
Copy link
Contributor

stirlingbot bot commented Feb 19, 2026

🚀 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
Copy link
Contributor

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
Copy link
Author

@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
Copy link
Author

intelliking commented Feb 22, 2026

@Frooodle @ConnorYoh Please review my PR. Thanks.

@Frooodle
Copy link
Member

/deploypr

@stirlingbot
Copy link
Contributor

stirlingbot bot commented Feb 22, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Split pdf into chunks of smaller size

3 participants