Using PDFTK to remove password from PDFs

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

Using PDFTK to remove password from PDFs

Post by pcarvalho » Thu Aug 12, 2021 6:47 pm

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 972 times

jan_suhr
Advanced member
Posts: 446
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Using PDFTK to remove password from PDFs

Post by jan_suhr » Thu Aug 12, 2021 6:59 pm

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 969 times
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps

Padawan
Advanced member
Posts: 316
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Using PDFTK to remove password from PDFs

Post by Padawan » Thu Aug 12, 2021 10:08 pm

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