← Back🔐 SECURITY

Lock PDF Online

Create a password-protected PDF right in your browser. Nothing is uploaded to our servers.

For reliable browser-only processing, PDFSwift creates a visually faithful, flattened protected copy of your document.
🔒

Drop a PDF here

or choose a file

A password on a stack of JPEGs

Lock PDF renders every page with PDF.js at scale 1.5, encodes JPEG at 0.92, and builds the output in jsPDF with userPassword and ownerPassword set to the same value. The permission list is print, modify, copy, and annot-forms. Minimum length is 4 characters. The two fields must match. There is no strength meter and no quality slider. If encryption cannot be constructed, you get an error, not a silently unlocked file.

The work stays in the tab. The Worker does not receive the PDF or the password. The page is loaded over HTTPS, which protects the scripts in transit. It does not escrow the secret. There is no server copy to wipe.

Locked download
Page contentJPEG, scale 1.5, quality 0.92
PasswordsUser and owner set to the same string
Minimum length4 characters
BrowserChrome or Edge if the constructor throws

Delivery copies, not the archive

A client who should not open the file by accident

Lock the copy that leaves. Store the password in a manager entry next to the filename. Do not put the secret in the filename. contract-pw-acme2024.pdf ships the key in every recent-files list.

After a visual signature

Sign on the text PDF, check the stroke at 150%, then lock. Zoom the locked file again. A thin stroke can break at JPEG 0.92.

An internal drive you already control

Prefer the folder’s permissions and keep real text. You will want to search the agreement next month. The JPEG stack will not let you.

A phone recipient

Open the download on a phone before you send it. Some mobile viewers loop on the password even when the desktop accepted it.

Set it, then prove both directions

  1. Drop the PDF. Enter the password twice. The button will not proceed if they differ or if the string is under 4 characters.
  2. Download. Open it and type the password. You should see page 1.
  3. Open it again and cancel the prompt. If it opens anyway, you did not lock it.
  4. Name the file -locked. Leave the master unlocked in a folder your team can open at 11 p.m.

The note about not locking the archive covers the filename mistake in more detail.

Prove the latch before you delete anything

Open the download and cancel the password dialog. The page must not render. Then open it again and type the password. If the first open succeeded, the constructor did not encrypt and the status should have said so. Do not mail a file that failed that test.

Keep the unlocked master in a folder that is not the outbox. The locked file is a JPEG stack at scale 1.5 and quality 0.92, which is a light compress with no slider. A second lock, after you “just change the password,” photographs the photograph. Change the password from the master, once.

Frequently asked questions

Is the locked file still the original PDF with a password flag?

No. Each page is drawn at scale 1.5 and encoded as JPEG 0.92, then placed in a new jsPDF document. User and owner passwords are the same string you typed. Text search from the source does not survive.

How short can the password be?

The page refuses fewer than 4 characters and it checks that the two fields match. Four characters is a floor, not a recommendation. Use a manager-generated string and send it on a different channel than the file.

Can PDFSwift recover the password?

No. Nothing is stored. If you lock the only copy and forget the secret, that download is done. Keep an unlocked master under a name that is not the delivery file.

Which permissions are set?

The constructor passes print, modify, copy, and annot-forms, with both passwords equal. Assume the secret gates opening. Test anything finer in a desktop reader before you promise it to counsel. If the browser cannot build the encrypted doc, the status tells you to try Chrome or Edge.

Does the lock stop screenshots?

No. Anyone who can open the file can photograph the screen. A password in the same email as the attachment is a ritual. This is a viewing latch, not a security program.

Should I lock before or after signing?

Stamp the signature on the real PDF first, then lock once. Locking is a JPEG pass. A second pass, after compress, crushes a thin pen stroke.