How ahmedabdelgelel/watermark-adder works
Watermark Print Pro is a desktop PDF/DOCX watermarking and printing application. Its main workflow is to open and select a document, preview it, configure watermark/footer and printer options, then convert if needed, apply overlays, and print. The graph preserves the document, print-job, and printer domain models; the README-documented UI capabilities; and the sampled use-case and adapter layers. Some UI wiring and printer setup are unsampled, so those relationships are omitted rather than inferred.
Main entry points: main_window.py Main window · print_document.py Print document · file_repository.py File repository port · open_file.py Open document
Components 20
Desktop interface
- Main window
app/presentation/views/main_window.py - PDF preview
app/presentation/views/preview_widget.py - Watermark settings
app/presentation/views/watermark_panel.py - Footer settings
app/presentation/views/footer_panel.py
Document and print workflow
- Document model
app/domain/models/document.py - Print job settings
app/domain/models/print_job.py - Printer model
app/domain/models/printer.py - Open document
app/domain/use_cases/open_file.py - Print document
app/domain/use_cases/print_document.py - File repository port
app/domain/ports/file_repository.py - Printer repository port
app/domain/ports/printer_repository.py - Watermark engine port
app/domain/ports/watermark_engine.py
Document processing
- PDF/DOCX repository
app/infrastructure/docx/docx_adapter.py - Watermark and render engine
app/infrastructure/pdf/pymupdf_engine.py
Printing and system
- System metadata
app/infrastructure/system/system_info.py - Qt printer adapter
app/infrastructure/printing/qt_printer_adapter.py - Temporary files
app/infrastructure/printing/temp_file_manager.py
Other components
- User
- LibreOffice / Word
- System printer
Connections 17
- User → Main window: uses
README.md - Main window → Open document: opens files
app/presentation/views/main_window.py - Open document → File repository port: validates
app/domain/use_cases/open_file.py - File repository port → PDF/DOCX repository: implemented by
app/infrastructure/docx/docx_adapter.py - Main window → PDF preview: shows preview
README.md - Main window → Watermark settings: configures
README.md - Main window → Footer settings: configures
README.md - Main window → Print document: starts printing
app/presentation/views/main_window.py - Print document → File repository port: loads and converts
app/domain/use_cases/print_document.py - Print document → Watermark engine port: applies overlays
app/domain/use_cases/print_document.py - Watermark engine port → Watermark and render engine: implemented by
app/infrastructure/pdf/pymupdf_engine.py - Watermark and render engine → System metadata: collects metadata
app/infrastructure/pdf/pymupdf_engine.py - Print document → Temporary files: writes and cleans
app/domain/use_cases/print_document.py - Print document → Printer repository port: sends print file
app/domain/use_cases/print_document.py - Printer repository port → Qt printer adapter: implemented by
app/infrastructure/printing/qt_printer_adapter.py - Qt printer adapter → System printer: prints through
- PDF/DOCX repository → LibreOffice / Word: converts DOCX
app/infrastructure/docx/docx_adapter.py