PDF Security & Access Issues

How to Protect Digitally Signed PDFs: Flattening vs Document Locking

Camila MilosovichCamila Milosovich Nov 3, 2026 869 views

Question details

The user wants to understand the concepts of PDF flattening and refrying, specifically asking if flattening is necessary to protect digitally signed documents from unauthorized modifications.

How to Protect Digitally Signed PDFs: Flattening vs. Document Locking
Product
PDF Editors
Device & OS
not provided
Scenario
Attempting to secure a completed PDF document containing digital signatures against unauthorized edits and extraction.
Observed behavior
Flattening or refrying a digitally signed document breaks the cryptographic hash and invalidates existing digital signatures, compromising document security rather than enhancing it.
Before you start

Before modifying your PDF, ensure you have finalized all content and saved a backup copy. Remember that any structural changes to a document after it has been digitally signed will permanently invalidate the existing cryptographic signatures.

Solution 1Recommended

Use Document Locking with the Final Digital Signature

The most secure and proper way to protect a signed PDF is to use the document-locking option during the final cryptographic signing process, which prevents further alterations without breaking the signature.

Flattening a signed document will immediately invalidate all digital signatures applied to it because it alters the underlying byte structure.

Instead of flattening, you should use the built-in locking feature during the final signature process. This locks down form fields and content while providing cryptographic evidence that the document has not been tampered with.

1
Access digital signature tools

Open your PDF document in your PDF editor and navigate to the 'Protect' or 'Digital Signature' tool tab.

2
Initiate the signing process

Click on the designated signature field, or draw a new signature field on the document to apply your final digital signature.

3
Enable document locking

In the signature dialog box where you select your certificate, check the box labeled 'Lock document after signing' before clicking the Sign button.

4
Save the protected document

Save the PDF to finalize the signature. Any subsequent attempts to edit the document will be blocked by the software, and unauthorized forced changes will display the signature as invalid.

Use Document Locking with the Final Digital Signature
Signature Integrity Maintained: Locking the document ensures that the digital signature remains legally valid while preventing other users from making unauthorized edits to the text or form fields.
Complete PDF Solution

Secure and Sign Your PDFs with WPS Office

WPS Office provides professional PDF editing tools, allowing you to easily manage form flattening, apply secure digital signatures, and lock documents against unauthorized modifications.

  1. 1. Open your PDF: Launch WPS Office and open the PDF document you wish to securely sign.
  2. 2. Navigate to protection tools: Go to the 'Protect' tab on the top ribbon to access the security and digital signature features.
  3. 3. Sign and lock: Click 'Sign Document', select your digital ID, and ensure the document is locked upon saving to secure your finalized file.
Fully compatible with standard Adobe PDF document formats and signature certificatesEasily flatten form fields and annotations before signingIntuitive signature locking features to prevent unauthorized editsCross-platform support for Windows, Mac, iOS, and Android
microsoft office alternative - wps office

Frequently Asked Questions

Why does flattening a PDF invalidate my digital signature?

Flattening alters the internal byte structure of the PDF by converting interactive form fields and annotations into static graphic objects. Cryptographic digital signatures mathematically rely on the exact structure of the document at the time it was signed; any change to this structure breaks the cryptographic hash, rendering the signature invalid.

What does it mean to "refry" a PDF?

Refrying a PDF refers to the process of recreating a PDF by printing it to a virtual PDF printer (like "Print to PDF") or rasterizing it. This is generally discouraged as a security method because it strips out critical metadata, ruins text searchability, removes accessibility tags, and degrades image quality.

Are flattened PDF objects completely secure from extraction?

Not necessarily. Standard flattening processes often convert elements into standard graphic objects within the PDF rather than a single flat image. With advanced PDF editors, these graphic objects (like an image of a handwritten signature) can still be selected, copied, and extracted. True rasterization (exporting to an image) is required to merge them into an indistinguishable background layer.

Should I flatten a PDF before or after digitally signing it?

If you need to flatten form fields or comments, you must do so before applying any digital signatures. Once the document is flattened to your satisfaction, you can apply the digital signature and use the 'Lock document' option to secure the final version without invalidating the cryptographic certificate.