Merge multiple pdf files in sub folder
Posted: 31 Dec 2013 14:43
Hello,
This is my situation and i want to merge multiple pdf files in the subfolder and named it on todays date.
After creation/merger from single file and named on todays date delete all other pdf's.
Will use PDFtk.exe
Folder structure:
c:database\001\todays date(format 01-01-2014)\download\PDF\*.pdf
c:database\002\todays date(format 01-01-2014)\download\PDF\*.pdf
c:database\003\todays date(format 01-01-2014)\download\PDF\*.pdf
.....
....
I want automate it.
The below codes are working but i have to manually enter each sub folder and select the pdf files and create a merged pdf and delete the single ones.
This is my situation and i want to merge multiple pdf files in the subfolder and named it on todays date.
After creation/merger from single file and named on todays date delete all other pdf's.
Will use PDFtk.exe
Folder structure:
c:database\001\todays date(format 01-01-2014)\download\PDF\*.pdf
c:database\002\todays date(format 01-01-2014)\download\PDF\*.pdf
c:database\003\todays date(format 01-01-2014)\download\PDF\*.pdf
.....
....
I want automate it.
The below codes are working but i have to manually enter each sub folder and select the pdf files and create a merged pdf and delete the single ones.
- Using the below codes.
Open ..\pdftk\bin* and copy pdftk.exe and libiconv2.dll to a folder of your choice
create a new text file and paste the following code
create a shortcut of this .cmd and place it in your sendto folder
Go to a folder with some PDF files and select as many PDFs as you want
Right-click them and choose the shortcut you just created
a new binder PDF in the same folder will be created where all selected PDFs are merged into one
Code: Select all
@echo off
setlocal enabledelayedexpansion
FOR %%A IN (%*) DO (set command=!command! %%A)
pdftk.exe %command% cat output "%~dp1binder.pdf"