Page 1 of 1

Using PDFTK to remove password from PDFs

Posted: Thu Aug 12, 2021 6:47 pm
by pcarvalho
I'm using PDFTK to remove the password protection of PDF files and is working fine.
The problem is when the PDF password mismatch the one I've setup in the code.
The file simply disappear from switch
Can I set an error folder or some error notification for these cases?

This is my code:
Screenshot 2021-08-12 at 17.46.52.png
Screenshot 2021-08-12 at 17.46.52.png (31.59 KiB) Viewed 7537 times

Re: Using PDFTK to remove password from PDFs

Posted: Thu Aug 12, 2021 6:59 pm
by jan_suhr
You are not at the latest version in Switch.

There is some new features now, among them you can set an exit code as Private Data.

If you use the Fail if exit code is "in range" you can catch the failed job in the Problems job folder and send it from there to some place in the flow. With the Private data exit code you can then sort the PDF.

To find in which range it gives the error code from PDFTK run it in Terminal with the wrong password and see what codes you get, use that code then in Switch range.
Snag_4617571.png
Snag_4617571.png (20.07 KiB) Viewed 7534 times

Re: Using PDFTK to remove password from PDFs

Posted: Thu Aug 12, 2021 10:08 pm
by Padawan
If you use "Run Command", then you can use the error out connection to sort out failed jobs.
https://www.enfocus.com/en/appstore/product/run-command

You will also need to have switch 2021 spring to run it.