Created
October 10, 2018 04:59
-
-
Save earthiverse/0d95b2f642e59dd87f1ef2f27eb827ca to your computer and use it in GitHub Desktop.
Decrypting all files in a folder with qpdf and powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#TODO #1: Change the path to the folder you want to convert all the files | |
Get-ChildItem "C:\Users\Path\To\Folder\Full\Of\PDFs" -Filter *.pdf | | |
Foreach-Object { | |
Write-Host "Decrypting $($_.FullName)..." | |
# TODO #2: Change the path to your qpdf.exe executable. | |
C:\Path\to\qpdf\bin\qpdf.exe --decrypt $_.FullName "$($_.FullName).decrypted" | |
Remove-Item $_.FullName | |
Rename-Item "$($_.FullName).decrypted" -NewName $_.Name | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment