Skip to content

dmarsh400/pdf-flattener-gui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Flattener GUI

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.

Features

  • Simple GUI (Tkinter)
  • Robust flatten pipeline:
    1. qpdf: generate appearances + flatten annotations
    2. pdftocairo: page rewrite fallback
    3. Ghostscript: final rewrite fallback
  • Works on Linux and Windows
  • Local-user installer for Linux app menu integration

Why This Exists

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.

Project Files

  • 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

Requirements

  • Python 3 (Tkinter included)
  • At least one backend installed:
    • qpdf (recommended)
    • pdftocairo (from poppler-utils / poppler)
    • Ghostscript (gs on Linux, gswin64c on Windows)

Quick Start

Linux

cd /path/to/pdf-flattener-gui
./run.sh

Windows

run.bat

or:

python app.py

Linux App Menu Install (Local User)

chmod +x install-local.sh uninstall-local.sh
./install-local.sh

Check prerequisites only:

./install-local.sh --check

Auto-install missing dependencies (Linux distro package manager):

./install-local.sh --install-deps

This 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

./uninstall-local.sh

Windows Backend Install (Recommended)

Install tools with winget:

winget install qpdf.qpdf
winget install ArtifexSoftware.Ghostscript

Optional Poppler backend:

winget install oschwartz10612.Poppler

Output

Default output path is next to the source file:

  • Flattened_.pdf

License

MIT

About

Cross-platform GUI app to flatten problematic form PDFs with qpdf, pdftocairo, and Ghostscript fallbacks.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors