Stirling-PDF
Stirling-PDF copied to clipboard
Enhance multi-page PDF layout with advanced customization options (#397, #3655)
Description of Changes
Old behavior :
Previously, the user could only specify the number of pages per sheet, limited to 2, 3, or perfect square values, and the generated PDF was always in portrait orientation. Page ordering was fixed to left-to-right, then top-to-bottom, with no customization option.
New behavior :
- Introduced two modes :
- Default : Maintains the classic behavior for setting pages per sheet.
- Custom : Allows specifying the number of rows and columns for flexible layouts.
- The user can choose between four page ordering options :
- Left to right, then top to bottom (Default).
- Top to bottom, then left to right.
- Right to left, then top to bottom.
- Top to bottom, then right to left.
- The user can choose the orientation of the output PDF document : Portrait (default) or Landscape.
How it was implemented :
The implementation builds on the existing PDFBox workflow, extending it to handle the new inputs and customization options without changing the core logic.
UI changes
-
Default mode :
-
Custom mode :
PDF samples :
- Original PDF : pdf.pdf
- After processing : pdf_2PagesPersheet_Portrait_leftToRightTopToBottom.pdf pdf_4PagesPersheet_Landscape_RightToLeftTopToBottom.pdf pdf_3Rows_2Cols_Portrait_TopToBottomLeftToRight_Border.pdf pdf_2Rows_3Cols_Landscape_TopToBottomRightToLeft_Border.pdf
Closes #397 and #3655
Checklist
General
- [x] I have read the Contribution Guidelines
- [x] 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
- [x] My changes generate no new warnings
Documentation
- [ ] I have updated relevant docs on Stirling-PDF's doc repo (if functionality has heavily changed)
- [ ] I have read the section Add New Translation Tags (for new translation tags only)
Translations (if applicable)
- [ ] I ran
scripts/counter_translation.py
UI Changes (if applicable)
- [x] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR)
Testing (if applicable)
- [x] I have tested my changes locally. Refer to the Testing Guide for more details.
🚀 Translation Verification Summary
🔄 Reference Branch: pr-branch-messages_en_GB.properties
📃 File Check: messages_en_GB.properties
- Test Status: ✅ Passed
- Test Status: ✅ Passed
- Test Status: ✅ Passed
📃 File Check: messages_en_US.properties
- Test Status: ✅ Passed
- Test Status: ✅ Passed
- Test Status: ✅ Passed
📃 File Check: messages_fr_FR.properties
- Test Status: ✅ Passed
- Test Status: ✅ Passed
- Test Status: ✅ Passed
✅ Overall Check Status: Success
Thanks @OUNZAR-Aymane for your help in keeping the translations up to date.