- Code: Select all
qpdf $1 --decrypt --password=xxxxxxxx --replace-input
ocrmypdf --force-ocr --deskew $1 $1
I decided to split this into two actions, with the first being the qpdf command, but checking for a specific file name...
- Code: Select all
if [[ $1 == myEncryptedFile ]]; then
qpdf $1 --decrypt --password= xxxxxxxx --replace-input
else
echo "No Match"
fi
I have enabled Hazel debugging and when the action runs it drops inside the if statement, but then fails on the qpdf command. Here is the script output...
2023-09-11 18:12:57.616 hazelworker[80066] DEBUG: == script output ==
EncryptedPdfError: Input PDF is encrypted. The encryption must be removed to
perform OCR.
For information about this PDF's security use
qpdf --show-encryption infilename
You can remove the encryption using
qpdf --decrypt [--password=[password]] infilename
== End script output ==
The files security allows all actions once decrypted. I changed my qpdf format to that provided in the script output, but receive the same output. I am at a loss as I mentioned before. Any help would be appreciated.