Skip to Content
NexPDF

Encryption and permissions

Let users encrypt PDFs with AES-256 and permissions, remove passwords, and add watermarks, headers, footers and Bates numbers in an Electron window with NexPDF.

English

License module

Encrypting, removing passwords, watermarks, headers, footers and Bates numbering need the security module (Startup tier and above). Opening encrypted files works without a key.

Open an encrypted PDF

When the user opens a password-protected file with the window's own Open button, the window asks for the password. The user (open) password or the owner password both work.

From code, pass the password: openPdfWindow({ file, password }), pdf.open(file, { password }) or openDocument(engine, bytes, name, { password }) (1.0.1 and later). The File, Open… menu item sends no password, so an encrypted file opened with it fails to open. See Opening and saving.

The Protect mode

The Protect mode (security) has:

ToolWhat it does
EncryptEncrypts with AES-256: an open password, a permissions password, and whether printing, copying and editing are allowed
Remove passwordSaves the document without encryption
WatermarkAdds a text watermark, or removes all NexPDF watermarks
Header & footerAdds a header and footer to every page
Bates numberingNumbers every page with a prefix
Document propertiesEdits the title, author, subject and keywords
ISO standardsConverts to PDF/A, PDF/UA, PDF/X, PDF/E or PDF/VT; see PDF/A and PDF/UA
Color separationPreviews the cyan, magenta, yellow and black plates and measures ink coverage

Offer it

{ "modeConfig": { "availableModes": ["viewer", "security"] } }

Pass the configuration as the path of a JSON file; see Viewing pages.

From code

To encrypt or stamp documents in code, use the document API (openDocumentFile, then the calls of the Node.js SDK).

On this page