Flatten PDFs
Bakes form fields, comments, highlights, stamps and other annotations into the page so they can no longer be edited, hidden or removed, writing flattened copies.
Flatten PDFs draws each form field and annotation onto the page exactly as it is shown on screen, then removes the live field or annotation. The result looks the same but can no longer be typed into, moved, hidden or deleted. Flattened copies go to the run's files folder in the same folder structure; the originals are not changed. A PDF with nothing to flatten is copied byte for byte.
Nothing is silently lost. Comment text that is not visible on the page, such as the text of a sticky note, a reply or a highlight's note, is saved to comments.csv before the comment is removed. Annotations that are hidden, on a layer that is switched off, or have no stored appearance are left as they are and counted in the report.
Use it when
- Completed forms are being produced and the entered values must be fixed on the page.
- Documents carry reviewer highlights, stamps or comments that should become part of the page before production or filing.
- Before splitting or combining PDFs that contain form fields, so their values stay visible.
How to run it
- Choose the folder of PDFs as Input and an Output folder outside it. Only
.pdffiles are processed. - Leave include-links off unless hyperlinks should also be removed.
- Turn on forms-only if comments and markup should stay as they are.
- Click Run and read the notes.
- Click Open report and check the counts and the Notes column for each file.
- If the notes mention
comments.csv, open it from the run folder.
Settings
Every setting has the same help beside it in the app. On the command line, pass each as --name value; ltk help flatten-pdfs lists them.
Settings
| Setting | What it does | Type and default |
|---|---|---|
Include links--include-links |
Also flatten hyperlinks. Off (default): links are kept so they still work; they normally have no visible appearance to bake in. A link that has a stored appearance is drawn onto the page and removed, so it no longer works. Most links have no appearance; those are left in place and counted in AnnotationsLeft. |
yes/nofalse |
Forms only--forms-only |
Only flatten form fields. Comments, highlights, stamps and other annotations are left as they are. Only form fields are baked in; the interactive form is removed once all its fields are. Comments, highlights, stamps and links are kept as live annotations, and nothing is written to comments.csv. |
yes/nofalse |
Common settings
| Setting | What it does | Type and default |
|---|---|---|
Input required--input |
Folder (or single file) to read. It is opened read-only and never modified. | folder empty |
Output required--output |
Folder for reports. Must not be inside the input folder. Each run gets its own sub-folder. | folder empty |
Recurse--recurse |
Include sub-folders. | yes/notrue |
Extensions--extensions |
Only process these extensions (e.g. .pdf, .docx). Empty means the tool's default set. | list empty |
Parallelism--parallelism |
Files processed at once. Use 1-2 for spinning disks or network shares. | number4 |
What you get
Each run creates its own folder inside the output folder, with the report flatten-pdfs.csv, errors.csv and manifest.json (see Run folders and manifests).
files\…: The flattened copies, with the same names and folder structure as the input.flatten-pdfs.csv: One row per PDF: Status (Flattened, or Nothing to flatten), Pages, FieldsFlattened, AnnotationsFlattened, AnnotationsLeft, CommentsSaved, Destination, MD5 and Notes.comments.csv: Written only when there is comment text to save: File, Page, Id, Type, Author, Modified, Text and InReplyTo (the Id of the comment a reply answers).errors.csv: PDFs that could not be opened (damaged or password-protected), with the reason. The run carries on with the others.
Report columns
RelativePathFileNameStatusPagesFieldsFlattenedAnnotationsFlattenedAnnotationsLeftCommentsSavedDestinationMD5NotesSourcePath
Check the result
- Look at AnnotationsLeft. Anything left is still live in the copy; the Notes column says why (hidden, on a layer that is off, or nothing stored to draw).
- Read the Notes column for signature fields: a flattened signature keeps its look but can no longer be verified in the copy.
- Notes also flag annotations that were set not to print (they now print) and forms whose stored appearances may not show the latest values.
- Open a flattened copy and compare it with the original at the pages that had fields or comments.
- Keep
comments.csvwith the run if the comments themselves might matter, for example reviewer notes on a draft. - If some fields could not be flattened, the form is kept with only those fields in it; the Notes column says so.
- Flattening shows what the PDF has stored for each field. If the notes say the form asked viewers to redraw its fields, open the original and confirm the values shown in the copy are current.
- Hidden annotations and those on switched-off layers are deliberately left alone. Check them before production, as they remain in the file.
From the command line
The command line is part of LitTechKit Pro. See Command line.
ltk run flatten-pdfs --input "D:\Matter\Production 1\PDF" --output "D:\Matter\Production 1\Flattened"
Related tools
- Bates Stamp: Stamps sequential Bates numbers and an optional legend (e.g. CONFIDENTIAL) on every PDF page, correctly placed on rotated and cropped pages, writing stamped copies with a Beg/End Bates report.
- Combine PDFs: Combines PDFs into one: all of them, one per folder (e.g. an email with its attachments), or one per family by name. Each document is bookmarked, with its own bookmarks kept beneath.
- Split PDFs: Splits PDFs into parts no larger than a file size (for court upload limits) or of a set number of pages, named name_001.pdf… or by Bates number. Bookmarks are kept in the part they point to.
- Redaction Check: Finds failed redactions in PDFs: text still under black boxes or annotations, redaction marks never applied, and (optionally) terms that should not appear anywhere, including properties, bookmarks and comments.