How to Batch Combine Files in Subfolders and Rename PDFs Automatically
Question details
The user needs a way to automatically combine multiple files located within various subfolders into single PDF files, naming each resulting PDF after its parent folder to avoid manual processing.

- Product
- Adobe Acrobat / PDF Editors
- Device & OS
- not provided
- Scenario
- Managing large numbers of documents organized by folder that need to be compiled into single, neatly named PDF archives.
- Observed behavior
- Native PDF merging tools often require users to manually select files for each folder and type the output name manually, which is highly inefficient for bulk processing.
Ensure all files within your subfolders are in supported formats (like DOCX, JPG, or PDF) before attempting a batch combine, and temporarily back up your original folders to prevent accidental data loss during automated processing.
Use Adobe Acrobat Action Wizard with Custom JavaScript
For advanced users, writing a custom JavaScript within Adobe Acrobat's Action Wizard allows you to loop through folders, merge files, and save them dynamically using the parent folder's name.
Adobe Acrobat Pro includes an Action Wizard that can automate repetitive tasks across multiple files. However, because native tools do not dynamically grab folder names for saving, you must incorporate a custom JavaScript script into your Action sequence to achieve auto-renaming.
Open Adobe Acrobat Pro, click on the 'Tools' tab, and scroll down to select 'Action Wizard'.
Click 'New Action' in the toolbar to create a custom batch process. Under 'Files to be Processed', click 'Add Folder' and select your root directory containing the subfolders.
From the 'More Tools' section on the left panel, select 'Execute JavaScript' and add it to your action steps on the right.
Click 'Specify Settings' on the JavaScript step and enter your custom script designed to parse the file path, extract the parent folder's name, and execute the saveAs() function. Save the action.
Click on your newly created Action in the Action Wizard list and click 'Start' to process your subfolders.

Utilize Dedicated Batch PDF Merger Software
Standalone PDF batch tools or custom third-party scripts can automatically handle subfolder merging and dynamic renaming without needing you to write manual code.
Quickly Combine PDF Files with WPS Office
While complex automated subfolder scripting requires standalone programming tools, WPS Office provides a highly intuitive and fast PDF merger for standard batch combining tasks. You can easily add multiple files from your folders, arrange their order, and export them as a single PDF in seconds.
- 1. Access the PDF Merge Tool: Open WPS Office, navigate to the 'Tools' tab, and click on 'Merge PDF' to open the processing window.
- 2. Add Your Files: Click the 'Add Files' button to browse your folders and select the documents or images you wish to combine into a single PDF.
- 3. Arrange the Sequence: Drag and drop the imported files within the interface to adjust their page order exactly how you want them to appear.
- 4. Merge and Save: Specify your desired output name and save location at the bottom, then click 'Merge' to generate your combined PDF document.

Frequently Asked Questions
Can I batch combine files of different formats (e.g., Word and JPG) into a PDF?
Yes, most professional PDF editors, including WPS Office and Adobe Acrobat, allow you to select various file types and will automatically convert them to PDF format before merging them together.
Why doesn't Adobe Acrobat automatically name merged files after the parent folder by default?
Native Acrobat merging tools intentionally prompt for a manual save location and file name to ensure the user retains complete control over the output. Dynamic naming based on folder structures requires custom JavaScript or specialized Action Wizard configurations.
Is there a free way to batch combine folders into PDFs?
While basic manual PDF merging is free in many tools like WPS Office, fully automating subfolder loops with dynamic file renaming typically requires premium software features (like Acrobat Pro's Action Wizard) or specialized paid batch utility scripts.
Will merging multiple files reduce the quality of the original documents?
No, combining files into a PDF simply appends the pages together without degrading quality. However, if your merging tool has built-in optimization or compression settings enabled by default, it might compress images to save space. Always check your export settings before merging.




