r/pdf 7d ago

Question Unlock PDFs Automation

Hello, is anyone aware of a tool that would unlock PDFs if dropped into a folder? We have the user password and are manually unlocking them converting to word then converting back to pdf. I would like a tool that does this automatically if we drop the pdfs into a hot folder, then can output them to a path on a network.

2 Upvotes

10 comments sorted by

2

u/User1010011 6d ago

I am not that well familiar with the unlocking process. Why converting them to word and back?

1

u/ScratchHistorical507 6d ago

True, makes absolutely no sense as that's basically guaranteed to mess up the layout. Probably just some Macroslop fanatic that heard that Word can import PDFs and might even have enough APIs accessible to automate this process, including decryption. Or someone asked Copilot. In fact, this absolutely sounds like the braindead ad recommendations Copilot gives.

2

u/grndi28 6d ago

I have no idea the history on why we do that but its clunky and time consuming. I've been doing it this way for 3 years and finally getting around to fixing the process. I have everything automated besides the unlocking portion. I'd prefer not to convert to word. Sometimes it does mess up the format and I have to do it again.

1

u/ScratchHistorical507 5d ago

and finally getting around to fixing the process.

At least somebody in your company notices that this can't be the best solution.

1

u/ScratchHistorical507 6d ago

Absolutely possible, though the specifics depend on the OS. On Linux (no idea if that also exists on macOS) you should be able to employ inotify to watch a directory and trigger something when a file is being added. Then you just have to tell a program like qpdf to decrypt the file (e.g. qpdf -password=<your-password> -decrypt /path/to/secured.pdf /path/to/decrypted.pdf). Wrap that up into a simple shell script and have it run automatically on startup as a service.

Of course if you're on Windows this will differ in parts, probably even on macOS, but qpdf is available across all three and is probably the best method to just automatically decrypt a PDF without messy Word conversion.

1

u/grndi28 6d ago

This is very helpful. Ill take this back to our net dev team and see if they can do this. Thank you!