Repository-driven docs

PDF Editor Offline documentation

This static page was generated from the repository itself. It documents the web app, API, CLI, core Python modules, examples, sample PDFs, screenshots, roadmap, and release checks currently present in the codebase.

Package
pdf-editor-offline version 2.0.0
Backend
FastAPI with PyMuPDF-powered core modules
Frontend
React, TypeScript, Vite, Tailwind-style utility classes, Fabric.js, pdf.js
CLI
Typer command app exposed as pdf-editor-offline

Architecture

api/

FastAPI app with upload/session storage, tool routes, document routes, security headers, logging, rate limiting, CORS for local development, and sanitized user-facing errors.

frontend/

React workspace with editor, thumbnails, navigation, recent files, history, tool panels, upload flow, PDF viewer, and UI tests.

pdf_editor_offline/

Reusable Python package containing converter, manipulator, editor, text, rich text, navigation, annotation, image, metadata, privacy, and object inspection modules.

tests/ and frontend/tests/

Backend, API, Phase 4, Phase 5, smoke, frontend component, and lifecycle coverage. The repository currently contains more than 400 test definitions.

Tool map

EditingText insertion, rich text, page text, metadata, images, drawings, annotations, stamps, freehand highlights, and signatures.
ManipulationMerge, split, extract, insert, duplicate, resize, crop, organize, flatten annotations, remove blanks, numbering, headers, and footers.
ConversionPDF to Word, PowerPoint, Excel, JPG, Markdown, TXT, EPUB, SVG, PDF/A, plus Word, PowerPoint, Excel, HTML, Markdown, TXT, CSV, JSON, and images to PDF.
SecurityProtect, unlock, granular permissions, strict upload validation, safe errors, metadata cleanup, hidden data cleanup, and permanent redaction.
Advanced structureTOC, bookmarks, page links, font extraction, quad search, image extraction metadata, replacement, insertion, and optimization.
AutomationFastAPI routes, Typer CLI, Python classes, batch conversion, auto-merge folder, and template processing.

API surface

The FastAPI app registers document-scoped routes and file-based tool routes. The codebase currently exposes more than 100 route decorators across `api/routes/documents.py` and `api/routes/tools.py`.

Document sessions

Upload, inspect, download, delete, page render, metadata, privacy cleanup, page transforms, annotations, images, TOC, bookmarks, links, optimization, and maintenance cleanup.

File tools

Merge, split, compress, convert, sign, watermark, rotate, protect, unlock, repair, OCR, compare, batch convert, auto-merge folder, and template processing.

Manual backend startup
PYTHONPATH=. python -m uvicorn api.main:app --host 0.0.0.0 --port 8000 --reload

CLI and Python usage

The Typer CLI exposes extract, edit, inspect, and add command groups. The Python package exposes reusable converter and manipulator classes.

CLI commands
pdf-editor-offline extract text input.pdf
pdf-editor-offline extract images input.pdf --output-dir ./images
pdf-editor-offline edit metadata input.pdf title "Quarterly Report"
pdf-editor-offline edit delete-page input.pdf 0 --output output.pdf
pdf-editor-offline inspect object-tree input.pdf
pdf-editor-offline add image input.pdf stamp.png 0 100 120 180 80 --output stamped.pdf
Python API
from pdf_editor_offline import PDFConverter, PDFManipulator

converter = PDFConverter()
converter.pdf_to_word("input.pdf", "output.docx")

manipulator = PDFManipulator()
manipulator.merge_pdfs(["file1.pdf", "file2.pdf"], "merged.pdf")

Security and privacy

  • AES-256 and AES-128 PDF protection with password length validation.
  • Separate PDF permissions for print, copy, edit, annotate, form fill, accessibility, assembly, and high-quality print.
  • Strict file validation for content type, PDF signature, size, extension, and unsafe filenames.
  • Metadata cleanup for document metadata and XML metadata.
  • Hidden data cleanup for hidden text, embedded files, JavaScript, thumbnails, links, annotations, and form data when requested.
  • Permanent redaction with garbage collection so removed text is not recoverable.
  • App-owned temp and stale-session cleanup.

Sample PDFs

The repository includes small fixture PDFs for demos, screenshots, and manual smoke tests.

Verification and release checks

The release checklist in the repository asks for backend tests, frontend tests, frontend build, formatting checks, Docker build, package build, and manual PDF smoke tests.

Full local check
python -m pytest -q
cd frontend && npm test && npm run build
python -m black --check api pdf_editor_offline tests
git diff --check

Copied source docs

These files are copied into site/assets/docs/ so the generated folder remains portable.