Combine PDF files with a context menu option

I needed a way to quickly combine two or more PDF files without having to run a program or click mutiple times. This solution basically allows you to right click and automatically combine your PDF files then delete them once it’s finished combining.

First download a program called pdftk, once installed head over to where you actually installed it, copy two files; “pdftk.exe” and “libiconv2.dll” to a new folder (preferably where you will not accidently delete it).

Create a new text file and rename it to “PDF Combine.cmd”, edit the batch file and copy paste the below code:

@echo off
setlocal enabledelayedexpansion

for /f “tokens=2 delims==+-” %%i in (‘WMIC OS Get LocalDateTime /value ^| findstr “=”‘) do (
set _Date=%%i
set YY=!_Date:~2,2!
set MM=!_Date:~4,2!
set DD=!_Date:~6,2!
set HH=!_Date:~8,2!
set MIN=!_Date:~10,2!
set SS=!_Date:~12,2!
)
set today=20%YY%-%MM%-%DD%-%HH%%MIN%%SS%

FOR %%A IN (%*) DO (set command=!command! %%A)
D:\pdftk\pdftk.exe %command% cat output “%~dp1CombinedScan_%today%.pdf”

del %command%

The output file names for mine is “CombinedScan_DATE&TIME.pdf”. Make relavent changes preffered to you and save.

Now we want to set up the context menu for it so you can right click on files.

  1. Right click on your “PDF Combine.cmd” file, create a shortcut.
  2. Press your Windows key + R to bring up your run dialog. Type “shell:sendto”, which should open up your Windows SendTo folder. Move your shortcut you just created to this folder and feel free to rename your shortcut to whatever you prefer, I personally named it “Combine PDF’s”.

Now go ahead and test your automated method out. I recommend you use some spare PDF’s that are backups just in case you did something wrong. If you prefer to just skip downloading and copying the files, I’ve done that already and made a zip folder for you below.

Download pdftk.

Leave a Reply