Simple cross-platform desktop app to flatten PDFs with resilient fallbacks for broken AcroForm files.
Many forms fail to flatten cleanly because they contain orphaned widgets or missing appearance streams. This tool tries multiple backends in order so users still get a visible, non-editable output PDF.
- Simple GUI (Tkinter)
- Robust flatten pipeline:
- qpdf: generate appearances + flatten annotations
- pdftocairo: page rewrite fallback
- Ghostscript: final rewrite fallback
- Works on Linux and Windows
- Local-user installer for Linux app menu integration
Some PDFs show warnings like:
- widget annotation is not reachable from /AcroForm
- document does not have updated appearance streams
When this happens, one backend is often not enough. This app automatically tries safer fallback paths.
- app.py: GUI app + flatten logic
- run.sh: Linux launcher
- run.bat: Windows launcher
- install-local.sh: Linux local install to app menu
- uninstall-local.sh: Linux local uninstall
- Python 3 (Tkinter included)
- At least one backend installed:
- qpdf (recommended)
- pdftocairo (from poppler-utils / poppler)
- Ghostscript (gs on Linux, gswin64c on Windows)
cd /path/to/pdf-flattener-gui
./run.shrun.bator:
python app.pychmod +x install-local.sh uninstall-local.sh
./install-local.shCheck prerequisites only:
./install-local.sh --checkAuto-install missing dependencies (Linux distro package manager):
./install-local.sh --install-depsThis installs:
- App files: ~/.local/share/pdf-flattener
- CLI launcher: ~/.local/bin/pdf-flattener
- Desktop entry: ~/.local/share/applications/pdf-flattener.desktop
If your menu does not refresh immediately, sign out and back in.
./uninstall-local.shInstall tools with winget:
winget install qpdf.qpdf
winget install ArtifexSoftware.GhostscriptOptional Poppler backend:
winget install oschwartz10612.PopplerDefault output path is next to the source file:
- Flattened_.pdf
MIT