Using PDFTK to remove password from PDFs

Post Reply
pcarvalho
Member
Posts: 24
Joined: Tue Dec 16, 2014 12:08 pm

Using PDFTK to remove password from PDFs

Post 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 7130 times
jan_suhr
Advanced member
Posts: 586
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Using PDFTK to remove password from PDFs

Post 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 7127 times
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Using PDFTK to remove password from PDFs

Post 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.
Post Reply