Blog · PDF tips

How to unlock a PDF you own

If you do not know the password, stop reading

This is not a cracker. Unlock PDF passes the string you type to PDF.js as password. Wrong string, PasswordException, and the status line says that password did not unlock the PDF. There is no wordlist, no “forgot password,” no support mailbox that can fetch the key. I have answered that question in email often enough to put it in the first paragraph. If the password is gone and you have no unlocked copy, the document is gone. Make a new one from the source files if you still have them.

If you are trying to open someone else’s file without their permission, stop. The tool is for documents you are allowed to open. Circumventing a control you do not own can be unlawful, and it also will not work here, because the tool never tries.

What you hold after a successful unlock

PDF.js renders each page at scale 1.5 onto a canvas, JPEG quality 0.92, and jsPDF writes a new PDF with no encryption block. The download name is your filename plus -unlocked. It opens without a prompt. That part I verify every time, because a download that still asks for a password is not the deliverable.

The other part I verify, and people skip: the text is no longer text. You traded the password for a stack of pictures. If you needed an unlocked file so you could extract text or search, this output will not do it. You would need a tool that decrypts the original objects and writes them back out. This one photographs the opened pages. Search died in the photograph.

GoalDoes this unlock get you there?
Open and read without typing the password againYes
Merge the file with others in a tool that rejects encryptionYes, as pages. They will be images
Copy a clause into an email as live textNo. Copy from the opened original before you repaint, or type it
Recover a password you forgotNo
Remove a certificate signature’s cryptographic statusYou get a visual copy. Treat any legal signature status as something to re-check, not as preserved

A file I unlocked for a boring reason

Accounts had a 9-page invoice locked with a password that lived in a shared inbox. The merge tool refused it. I unlocked a working copy, merged it with the PO, and sent the packet. Then I deleted the unlocked invoice off the desktop and left the locked original in the finance folder. The merged packet was images for those 9 pages plus real text for the PO. I noted that in the email so nobody tried to search the invoice lines inside the packet. They could search the PO. The invoice they had to read.

I did not re-lock the merged packet. It was going to three coworkers on an internal drive. Locking would have rasterized the PO text too, which was the part we actually queried later. Lock the copy that leaves the building. Do not lock the copy your own team has to grep with their eyes.

Wrong password, damaged file, weird encryption

Try the password in a desktop reader first. If Adobe or Preview also rejects it, the string is wrong or the file is damaged, and this page will not be kinder. Spaces at the end of a pasted password count. A password manager that copied a newline once cost me ten minutes. I paste into a plain text field and look at the length.

Some enterprise PDFs use encryption PDF.js does not open even with the right user password. The error will not be a friendly taxonomy. If a reader you trust opens it and this tool does not, use the reader’s “save a copy” and move on. Do not keep re-clicking.

Scale 1.5 at JPEG 0.92 is the same family of softness as a light compress, fixed, with no slider. Zoom the fee table and a signature before you delete the locked original. If a stroke is already faint, the unlocked copy is for reading on screen, not for reprinting as the archive. Keep the locked file. You can still open it with the password in a reader that does not repaint, and that reader’s view is closer to the bytes you were protecting.

Large page counts at this scale will spin a fan. A 200-page locked scan is a long loop of canvases. If it dies mid-way you do not get a partial download you should trust. Run it on a desktop, or split the locked file in a reader that can handle it, then unlock the piece you need. Unlocking “the whole data room” into JPEGs is how you fill a disk with worse copies of files you could have opened on demand.

After you edit, if you must send a protected file again, lock a new copy from the best available pages and accept another raster pass. I would rather re-export from Word and lock once than unlock-edit-lock-unlock-lock. Each pass is another photograph of a photograph. By the third one the footer is a rumor.

Names: invoice-unlocked-working.pdf is honest. invoice-final.pdf will get forwarded. The unlocked working copy is radioactive compared with the locked one. Treat the filename as a warning label.

What I still open in a desktop reader

If I need the original text layer, I type the password into a reader that decrypts for viewing and I copy from that window. I do not run this unlock at all. The reader shows the real page. This tool shows a photograph of the page and saves the photograph. Both are “unlocked” in conversation and they are not the same file. I pick the reader when the next step is quote, search, or extract. I pick this tool when the next step is a merge that refuses encryption and the recipient only has to look.

Copying a paragraph out of the reader does not create an unlocked PDF of the whole document sitting in Downloads. That is sometimes the better security outcome. The full unlocked JPEG stack is a complete copy with the latch removed. A single copied paragraph is a smaller leak if your goal was one clause for an email you are allowed to send. I decide the size of the derivative before I click. “Unlock the file” as a reflex produces the large derivative every time.

Wrong-file risk: the download is named like the original plus a suffix. Sort by date and you will still grab the locked one if a mail client cached it. I move the locked original into a subfolder called locked-original before I start, so the working directory only contains the new file when the job succeeds. If the job fails, the directory stays empty of unlocked copies, which is what I want. Failure should not leave a half-written PDF I might trust. This script does not emit the download until the loop finishes. A crash mid-loop leaves nothing new. Good. Do not go fishing in the temp folder for a partial and rename it.

If the unlocked copy is only a bridge into a merge, I merge and then I delete the unlocked bridge the same day, keeping the locked original. The merged packet still contains the photographed pages. I do not also keep a standalone unlocked invoice “just in case” on the desktop. Just in case is how the bridge file is still there in September, in a zip someone made of the whole desktop. Delete the bridge. The packet is the copy you meant to keep.