Scans all PDFs in the folder and applies your digital ID signature to all of them:
- If it finds a field labeled "Signature", applies it there
- If not, creates a new signature at the top-left corner of the document.
- Add
tools/sdkAddSignature.js
to theJavascripts
folder from your Acrobat installation folder.- Example path: "C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Javascripts"
- Restart Adobe Acrobat.
- There should now be a new command labeled "Add My Signature" under "Edit" › "Acrobat SDK JavaScript"
- Add your
certificate.pfx
into the same directory asSignPDF.exe
.
If you cannot export your .pfx
certificate, you can use this version to prompt the user to select a certificate:
- Add
./tools/without_pfx/sdkAddSignature.js
to theJavascripts
folder from your Acrobat installation folder.- Example path: "C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Javascripts"
- Restart Adobe Acrobat.
- There should now be a new command labeled "Sign all active documents" under "Edit" › "Acrobat SDK JavaScript"
- This will do two things:
- Retrieve your certificates. Select one.
- Scan the currently active documents for signature fields. Select one or choose to add a new field at the top-left corner of your screen.
- Input your password
No external executable required.
NOTE: You can also refer to this answer from StackOverflow.
- Open the Registry editor (regedit.msc).
- Navigate to
Computer\HKEY_CLASSES_ROOT\directory\background\shell
. - Right click on 'shell' › 'New' › 'Key'.
- Give it a name (e.g: 'Sign all PDFs from this directory'). This is how this command will appear in the Explorer context menu. You can change it later.
- Right Click on this new item › 'New' › 'Key'.
- Set it to 'command'.
- Right click on '(Default)' and point it to the executable.
- (Optional) Right click on item from step [4] above.
- Right click › 'New' › 'String Value'.
- Set it to 'Icon'.
- Double click on it and point it to the Adobe Acrobat executable.
You should now see a new context menu command called 'Sign all PDFs from this directory' with the Adobe Acrobat icon.
- Open all PDFs from the working directory in Adobe Acrobat (important!).
- Right click in Explorer.
- Click on 'Sign all PDFs from this directory'.
- Running
tools/gen_cert.ps1
in PowerShell generates a test certificate called "MY_TEST_CERTIFICATE.pfx"- The password is
password
.
- The password is
- Move this certificate in the same directory as
SignPDF.exe
.
- Go to
tools
directory. - Run
ps2exe .\install.ps1
(assummingps2exe
is installed in PowerShell).
- Windows 10
19044.2006
- Adobe Acrobat Standard DC (32 bit)
- Visual Studio Community 2022 with
.Net Framework 4.8
- Adobe SDK starting page: https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/gettingstarted.html
- Download the Adobe Acrobat SDK from here: https://console.adobe.io/downloads#
- Login › "Download resources" › "Downloads" tab › "Adobe Acrobat"