Skip to content
DevToolKit

Flatten PDF

Flatten PDF form fields and annotations into static page content. Bake filled-in values, remove interactivity, and lock documents for archival or distribution. No upload required.

pdf

Drop your PDF here, or click to browse

Files are processed entirely in your browser — never uploaded

Processed locally
Was this tool helpful?

How to Use

Flatten your PDF in four steps:

  1. Upload your PDF — Drag and drop the file or click the dropzone to browse. The tool reads the file locally and immediately scans for interactive elements: form fields (text inputs, checkboxes, dropdowns, radio buttons) and annotations (links, comments, highlights, stamps).
  2. Review the scan results — The tool displays the number of form fields and annotations detected. If the document contains digital signatures, a warning appears explaining that flattening will invalidate them.
  3. Choose a flatten mode — Select "Flatten Forms" to convert only form fields into static content while preserving annotations, or "Flatten All" to flatten forms and strip every annotation from the document.
  4. Download the result — Click the flatten button to process the document, then download the flattened PDF. The tool shows before-and-after file sizes so you can see the impact.

The entire operation runs in your browser using pdf-lib. Your PDF is never uploaded to any server, making this tool safe for confidential documents such as tax forms, legal contracts, and medical records.

About This Tool

Flattening a PDF is the process of converting interactive elements into static page content. In technical terms, it takes the appearance streams of form fields and annotations — the rendering instructions that define how each widget looks on screen — and bakes them directly into the page's content stream. The result is visually identical to the original but no longer contains any interactive objects that a PDF viewer could edit or modify.

A PDF form field (defined by the /AcroForm dictionary in the document catalog) consists of two linked components: a field dictionary that stores the field's value, type, and validation rules, and a widget annotation that controls how the field renders on a specific page. When pdf-lib's form.flatten() method executes, it reads each widget's appearance stream — which is a self-contained set of PDF drawing operators defining the field's visual state — and writes those operators into the page's main content stream. It then removes the widget annotation and its associated field dictionary, effectively transforming an editable control into a permanent graphic.

The distinction between "Flatten Forms" and "Flatten All" matters for document workflows. Flatten Forms targets only /Widget annotations linked to AcroForm fields — text inputs, checkboxes, radio buttons, dropdowns, and signature fields. Other annotation types like /Link (hyperlinks), /Highlight (text highlights), /Text (sticky notes), and /Stamp (stamps) remain intact. Flatten All goes further: after flattening forms, it iterates through every page's /Annots array and deletes all remaining annotation objects, producing a completely clean document with no interactive layers whatsoever.

Flattening differs fundamentally from rasterization (converting to images). A flattened PDF retains all its vector text, embedded fonts, and searchable content — only the interactive form layer is removed. Rasterization, by contrast, converts everything to pixels, destroying text selectability and dramatically increasing file size. This distinction is critical for archival workflows where documents must remain searchable and text-extractable while being locked against editing.

Digital signatures in PDF documents are cryptographic objects stored as /Sig-type form fields. They contain a hash of the document's byte range at the time of signing. Any modification to the document — including flattening, which alters content streams and annotation arrays — changes the byte sequence and invalidates the hash. This is why the tool warns when signatures are detected: the flattened output will be structurally different from the signed original, and signature validation will fail. For signed documents, best practice is to keep the original signed version alongside the flattened copy.

Why Use This Tool

Flattening PDF forms and annotations serves several important purposes across legal, administrative, and archival workflows:

  • Prevent unauthorized editing — Flattened form fields cannot be modified. This is essential when distributing completed contracts, applications, or compliance forms where the recorded values must remain fixed. Unlike PDF passwords (which can be removed by third-party tools), flattening permanently embeds values into the page content — there is no "unflatten" operation.
  • Archival and records management — Regulatory frameworks like PDF/A (ISO 19005) for long-term archival recommend or require that interactive elements be flattened before storage. Flattened documents are self-contained: they do not depend on external font servers, JavaScript execution, or form calculation scripts to render correctly decades later.
  • Print consistency — Interactive form fields sometimes render inconsistently across different PDF viewers and printers. A checkbox that appears checked in Adobe Acrobat may display differently in Preview, Chrome, or a commercial print RIP. Flattening eliminates these rendering variations by converting every field to standard PDF drawing operators that all renderers handle identically.
  • File size reduction — Form fields carry overhead: field dictionaries, appearance streams for multiple states (normal, focused, read-only), JavaScript actions, calculation order arrays, and the AcroForm dictionary itself. Flattening strips this metadata. Documents with hundreds of form fields — such as multi-page government forms or insurance applications — can see measurable size reductions after flattening.
  • Clean document distribution — Before sharing a PDF externally, flattening removes interactive clutter: empty form fields that display as bordered rectangles, comment threads visible to recipients, and highlight marks from internal review. The result is a professional, polished document suitable for clients, regulators, or publication.
  • Cross-platform compatibility — Some lightweight PDF viewers on mobile devices or embedded systems do not fully support AcroForm fields. Flattened documents display correctly everywhere because they use only basic PDF content stream operators — no form rendering engine required.

Processing PDFs locally in your browser is particularly important for flattening workflows. The documents most commonly needing flattening — completed tax forms, signed contracts, medical intake paperwork, HR onboarding documents — contain sensitive personal information. This tool guarantees that your document data stays on your device throughout the entire process, with no network requests, no server-side storage, and no third-party access to your content.

FAQ

What does it mean to flatten a PDF?
Flattening a PDF converts interactive elements — form fields, annotations, and widgets — into static page content. The visual appearance of filled-in fields and annotations is permanently baked into the page's content stream, making the document non-editable. The result looks identical to the original but behaves like a printed page: no fields can be clicked, filled, or modified.
Will flattening remove the data I entered in form fields?
No. Flattening preserves the current visual state of every form field. Text you typed, checkboxes you checked, and dropdown selections you made are all rendered as permanent graphics on the page. The difference is that after flattening, those values cannot be changed — they become part of the page image rather than editable form controls.
What is the difference between Flatten Forms and Flatten All?
Flatten Forms uses pdf-lib's built-in form.flatten() method to convert only AcroForm fields (text inputs, checkboxes, dropdowns, radio buttons) into static content. Flatten All goes further: it flattens form fields and also strips every annotation from every page — links, comments, highlights, stamps, and sticky notes — producing a completely clean, non-interactive document.
Does flattening invalidate digital signatures?
Yes. If a PDF contains a digital signature, flattening modifies the document's content streams and annotation arrays, which breaks the cryptographic hash that the signature validates. The tool warns you when it detects signature fields so you can decide whether to proceed. For signed documents, consider keeping an unflattened copy as the authoritative signed version.
Is my PDF uploaded to a server during flattening?
No. The entire flattening process runs locally in your browser using the pdf-lib JavaScript library. Your PDF is loaded into browser memory, processed client-side, and saved as a new file — it never leaves your device. This makes the tool safe for confidential documents like tax forms, contracts, medical records, and HR paperwork.