docs/tools/flatten-pdf.md
Flattening merges interactive elements -- form fields, dropdowns, checkboxes, annotations, highlights, sticky notes -- directly into the page content. The visual appearance stays the same, but nothing is editable or extractable anymore. It is the PDF equivalent of printing a filled-out form and scanning it back in, except the quality stays perfect.
The tool uses pdf-lib to flatten form fields (via form.flatten()) and a dedicated annotation flattener to burn annotations into the page stream. Both operations happen in a single pass.