[Feature Request]: Split merged PDF into N-page chunks with custom names from external file
Feature Description
Add support for splitting a PDF into fixed-size chunks (e.g., every N pages) and renaming the output files using a provided external list (e.g., a text file with one name per line).
Example workflow
- A Word template is 3 pages long.
- After performing a mail merge with 5 datasets, the result is a single 15-page PDF.
- The user wants to split this into 5 separate PDF files, each containing 3 pages.
- The output filenames should be taken from an external text file (e.g., names.txt), where each line corresponds to the filename for each split file.
So if names.txt contains:
FileA
FileB
FileC
FileD
FileE
The final output would be:
- FileA.pdf (pages 1–3)
- FileB.pdf (pages 4–6)
- FileC.pdf (pages 7–9)
- FileD.pdf (pages 10–12)
- FileE.pdf (pages 13–15)
Current behavior
Stirling-PDF supports:
- Splitting PDFs (per page or automated rules)
- Auto-renaming output files based on PDF content
I think it is very similar to this https://github.com/Stirling-Tools/Stirling-PDF/issues/223.
However:
- Auto-rename does not work well for my use case, because Chinese text is often not recognized correctly.
- Splitting cannot currently be done by fixed N pages.
Why is this feature valuable?
This feature would be useful for scenarios such as:
- Mail merge workflows (Word → PDF) where each dataset should have its own named PDF.
- Bulk generation of reports/invoices where filenames are predefined in a list.
- Workflows involving non-Latin text (e.g., Chinese), where auto-renaming fails.
I solved this with a simple bash script as a workaround, but it would be more convenient and user-friendly if integrated directly into Stirling-PDF.
Suggested Implementation
Proposal
- Add an option in the split tool to upload/select a text file (one line per filename).
- Apply those names in order when generating split PDFs.
If the team agrees with this proposal, I’d be happy to implement this feature and submit a PR.
Additional Information
No response
No Duplicate of the Feature
- [x] I have verified that there are no existing features requests similar to my request.
I would suggest going a step further and implementing the ability to read a mapping between file names and page ranges, something like this:
FileA : 1,2-5,8
FileB : 3,4-8,10
hello @omegaatt36 , have you started working on this feature or not yet?
hello @omegaatt36 , have you started working on this feature or not yet?
Not yet 🥲
Doesn't split-by-size-or-count do this?
AHH sorry missed the names.txt functionality
But the statement "Splitting cannot currently be done by fixed N pages" is incorrect so should have something to base code off
so can i work on this one ? @Frooodle @omegaatt36