Combining JPGS in folders and subfolders into PDFs
Posted: 2019-06-28T07:24:19-07:00
I have a script that, when I right click on a folder, combines all jpgs inside the folder into a PDF and renames the PDF to the name of the folder it resides in.
However, I have quite a lot of folders and currently have to do this one by one.
How can I create a function where I can right click on a folder, which searches subfolders and combines the jpgs to PDF?
So in the example below, Im wanting to create 3 PDFS (Folder A, Folder B and Folder C) by right clicking and running batch on the parent folder.
Example:
- Parent folder (one that I would right click and run script from)
|- Folder A
||- test1.jpg
||- test2.jpg
||- test3.jpg
|- Folder B
||- example1.jpg
|| - example2.jpg
|- Folder C
||- temp.jpg
||- temp2.jpg
I have attempted myself with the following, but no luck:
Hope you can help. Thank you.
Code: Select all
cd %~dpnx1
for %%a in (.) do set currentfolder=%%~na
start cmd /k magick "*.{png,jpg,tif}" "%currentfolder%.pdf"
How can I create a function where I can right click on a folder, which searches subfolders and combines the jpgs to PDF?
So in the example below, Im wanting to create 3 PDFS (Folder A, Folder B and Folder C) by right clicking and running batch on the parent folder.
Example:
- Parent folder (one that I would right click and run script from)
|- Folder A
||- test1.jpg
||- test2.jpg
||- test3.jpg
|- Folder B
||- example1.jpg
|| - example2.jpg
|- Folder C
||- temp.jpg
||- temp2.jpg
I have attempted myself with the following, but no luck:
Code: Select all
cd %~dpnx1
for %%a in (.) do set currentfolder=%%~na
FOR /R %%a in (*.jpg) DO (
magick "%%a" "%currentfolder%.pdf"
)