AnM is a Windows-first desktop app for annotating and merging PDFs with a Tkinter GUI. It is now packaged as a small Python project with a testable PDF pipeline, drag-and-drop workflow, safer output handling, and a reproducible local/CI build.
- Drag and drop PDF files or folders into the app.
- Keep a visible merge queue with include or exclude controls.
- Merge included files in the queue's top-to-bottom order;
Move UpandMove Downchange that order. - Add a filename-based annotation to every page.
- Adjust annotation template, position, font size, margin, and box opacity.
- Leave annotation text empty to merge without adding text or a box.
- Preview the current overlay on the first selected PDF.
- Write merged output to
output/annotated-merged.pdfby default, or choose another output folder. - Optionally keep intermediate annotated PDFs under
output/annotated/. - Open the output folder automatically after a successful run.
- App-generated PDFs are excluded from future discovery so reruns do not re-merge old output.
- Temporary working files are created under
output/.tmp/and removed automatically when intermediate files are not being kept. - If the merged output already exists, the app asks before overwriting it.
- The GUI output folder defaults to the first included PDF's
outputfolder unless you choose another folder.
- Python 3.11+
- Windows is the primary supported desktop target
- Tkinter (typically included with Python)
Runtime dependencies:
PyMuPDFtkinterdnd2
python -m pip install -e ".[dev]"Either entry point works:
python annotate_and_merge.pyor
anmanm with no arguments opens the GUI. Add a command to run the CLI:
anm --help
anm help merge
anm --versionMerge explicit PDFs in the order provided:
anm merge .\a.pdf .\b.pdf --output .\output\merged.pdfMerge all source PDFs in a folder using the same generated-output filtering and natural sort order as the GUI:
anm merge-dir .\pdfs --output .\output\merged.pdf --overwriteMerge without adding an annotation:
anm merge .\a.pdf .\b.pdf --template "" --output .\output\merged.pdfPreview the annotation on the first page:
anm preview .\a.pdf --output .\preview.pngInspect PDFs or verify the local runtime:
anm info .\a.pdf --json
anm doctorUseful merge options:
--template,--position,--font-size,--margin,--opacity--overwrite,--keep-intermediate,--open-folder--dry-runto show inputs, output path, and overwrite status without writing files--jsonfor stable machine-readable output
python -m ruff check .
python -m pytestpwsh ./scripts/build_windows.ps1This creates a PyInstaller build under dist/AnM/.
src/anm/pipeline.py: PDF discovery, annotation, merge, preview, cleanup.src/anm/gui.py: Tkinter desktop workbench, drag and drop, progress UI.src/anm/cli.py: argparse CLI for power users, scripts, and AI agents.src/anm/app_state.py: queue ordering and generated-file filtering helpers.tests/: unit, integration, and GUI smoke coverage.
- Add fresh screenshots or a short GIF here once the upgraded UI is visually finalized.
If workflow, build, release, or developer setup behavior changes, update AGENTS.md, this README, and the corresponding config or CI files together.