Flatten PDF
Merge annotations, forms and transparency into pages
Files are processed only in this browser. Nothing is uploaded to a server.
Merge annotations, form fields and transparency into the page for a fixed PDF
This PDF is password-protected.
Continue in another tool
Processing…
Everything runs inside this browser. Your file is never sent to a server.
Your file is ready to download
Continue with this result
Open page preview
Changing a setting hides the previous result. Run it again to save the latest settings.
Remove the password from an encrypted PDF first. The whole file is rewritten, so any existing digital signature becomes invalid. Keep the original and check the result.
Working…
0.0
It hasn't frozen — the result will appear when the calculation finishes.
About Flatten PDF
Annotations and form fields in a PDF aren't part of the page content. They're separate objects sitting on top of it. A highlight, a sticky note, a stamp, a typed name or a checkmark each carries its own appearance stream, a small drawing that says what it looks like, and the viewer paints it over the page. Flattening moves those drawings into the page content itself and then deletes the annotation and form structures.
This tool lets you switch three things on or off independently: merging annotations, merging form fields, and flattening transparency. The first two copy vector drawing commands across, so nothing loses quality. Only the third turns pages into images.
When an unflattened PDF causes trouble
Annotations and fields are interpreted by the viewer, so the result depends on the software at the other end. These are the usual problems.
- Missing from the printout. Each annotation has its own print flag in the PDF spec, so a comment or stamp that shows on screen may simply not print.
- Values that look different. A form saved without appearances and flagged NeedAppearances asks each viewer to redraw the fields, so fonts and line breaks change from one app to the next. Non-Latin values turning into empty boxes usually comes from this.
- Still editable. The recipient can clear or change the values and markup. If a submitted application has to stay exactly as filled in, it needs to be fixed in place.
- Print shop RIPs. Older output devices can mishandle transparency (opacity, blend modes, soft masks) and produce white boxes or color shifts.
How the tool merges annotations
Each annotation's normal appearance (/AP /N) is invoked as a Form XObject on the page. Its bounding box is transformed by the appearance matrix and fitted onto the annotation rectangle (/Rect), following the placement algorithm in section 12.5.5 of the spec. Checkboxes and radio buttons use the appearance for their current state (/AS).
Hidden and NoView annotations are removed without being drawn, and popups attached to notes go with them. An annotation with no appearance at all gives the tool nothing to draw, so it's left in place and counted in the summary. Links can stay clickable or be removed.
Form flattening and the order of signing
Form mode first generates appearances for fields that lack them, draws every widget into the page and removes the AcroForm and XFA structures. If a value contains characters the standard fonts can't draw, the tool embeds Noto Sans KR for Korean or Noto Sans JP for Japanese kana and kanji to render it. XFA-only dynamic forms can't be interpreted in the browser; only whatever appearance is left in the AcroForm widgets gets merged, so those pages can come out blank.
A digital signature hashes the file's bytes at the moment of signing. Flattening rewrites the file, so flattening a signed PDF leaves the signature's picture but breaks its validation. The order is fill, flatten, then sign. Flattening a form with an empty signature field also deletes the place to sign, so for documents that still need a signature, turn form flattening off and merge annotations only.
What transparency flattening costs
The tool scans page resources for opacity below 1, soft masks, blend modes other than Normal, semi-transparent images and transparency groups that the content actually uses. With flattening on, each such page is rendered by pdf.js at the resolution you choose and replaced with a single JPEG at quality 90.
Those pages lose selectable and searchable text, blur when zoomed and usually grow in size. Use it only when a print shop has flagged transparency, and keep it limited to detected pages.
Worked examples
Pixel count by transparency flattening resolution
- Input
A4 page (8.27×11.69 in) at 150 DPI / 300 DPI; US Letter (8.5×11 in) at 300 DPI- Output
About 1240×1754 / 2481×3508; Letter 2550×3300
Doubling the DPI doubles both dimensions, so 300 DPI has four times the pixels (about 8.7 million on A4). Use 300 for print submission and 150 for screen sharing. If the page was vector text before, either setting will probably make it bigger.
A marked-up contract
- Input
12 highlights, 3 notes, 3 popups; merge annotations- Output
The 12 highlights and 3 note icons are drawn onto the page; the 3 popups are deleted
The text of a note lives only in its popup, so only the icon ends up on the page. If the comments themselves matter, export or summarize them before flattening.
An application that still needs a signature
- Input
20 filled fields plus one empty signature field- Output
Merge annotations only; keep the form
Flattening the form would remove the empty signature field and leave nowhere to sign. Once the document is signed, don't flatten it at all.
How to use it
- Add the PDF and review the annotation counts by type, form fields, XFA presence and pages with transparency.
- Choose whether to merge annotations and forms, and whether links stay clickable.
- Only if needed, enable transparency flattening for detected pages and pick a resolution; then run and check the summary and preview.
Key terms
- Appearance stream (/AP)
- The drawing commands that give an annotation or field its look. It can have separate normal (N), rollover (R) and down (D) versions.
- AcroForm / XFA
- The two PDF form technologies. AcroForm is based on widgets on the page; XFA defines the form in XML and was deprecated in PDF 2.0.
Frequently asked questions
Can flattening a PDF be undone?
No. The annotation and field data is removed and only their appearance stays on the page. Keep the original.
My comment text disappeared after flattening.
A note's text lives in its popup, so only the icon is drawn onto the page. Save a comment summary first if you need the text.
Does flattening make the file smaller?
Merging annotations and forms barely changes size, may add a little if a font has to be embedded, and pages flattened for transparency usually get bigger.
Why are some annotations left behind?
Some apps don't save an appearance and let the viewer draw the annotation on the fly. With nothing to draw, the tool leaves them. Re-saving from the original app often creates the appearance.
Is flattening required before e-signing?
Not required, but flattening has to happen before signing if it happens at all, because any rewrite after signing invalidates the signature.
Sources
- Adobe — PDF 1.7 / ISO 32000-1:2008, 12.5 Annotations, 12.7 Interactive forms, 11 Transparency
- PDF Association — ISO 32000 (PDF) resources
- pdf-lib — PDFForm.flatten
- Mozilla — pdf.js
Last reviewed: