Skip to content

Repository files navigation

PDF Editor

A cross-platform desktop PDF editor built with Electron, React, and TypeScript.

Features

Phase 1: Core Viewer ✅

  • ✅ Open and view PDF files
  • ✅ Split-pane layout with thumbnail navigation
  • ✅ Zoom in/out/fit controls
  • ✅ Natural scrolling through pages
  • ✅ Page selection via thumbnails

Phase 2: Basic Editing ✅

  • ✅ Save and Save As functionality
  • ✅ Print PDF documents
  • ✅ Delete pages with confirmation
  • ✅ Insert blank pages
  • ✅ Unsaved changes tracking
  • ✅ Keyboard shortcuts (Ctrl/Cmd+S, Ctrl/Cmd+P, etc.)

Phase 3: Advanced Editing ✅

  • ✅ Insert images (PNG/JPG) with free positioning
  • ✅ Insert text with free positioning and styling
  • ✅ Export to Word (.docx)
  • ✅ Export to plain text (.txt)
  • ✅ Export pages as images (PNG)

Phase 4: Advanced Features ✅

  • ✅ Merge multiple PDF files with drag-to-reorder
  • ✅ Add text watermarks with customization (position, size, opacity, rotation, color)
  • ✅ Add image watermarks with positioning (PNG/JPG)
  • ✅ Add headers with page numbers and custom formatting
  • ✅ Add footers with page numbers and custom formatting
  • ✅ Erase content in rectangular regions
  • ✅ Replace pages from another PDF
  • ✅ Reverse page order
  • ✅ Add highlights to regions with custom colors

Phase 5: Complete Feature Enhancement 🚧 (In Development)

  • ✅ View modes (1:1, fit page, fit width, two-page)
  • ✅ Quick page navigation
  • ✅ Text search in PDF
  • 🚧 PDF converter (to TXT, Word, Images)
  • 🚧 Images to PDF converter
  • 🚧 Extract images from PDF
  • 🚧 Split PDF
  • 🚧 Extract pages
  • 🚧 Reorder pages
  • 🚧 Add page numbers
  • 🚧 Redact sensitive content
  • 🚧 Compress PDF
  • 🚧 Add signature
  • 🚧 Password protection
  • 🚧 Optimize PDF

Tech Stack

  • Electron - Desktop application framework
  • React - UI library
  • TypeScript - Type-safe development
  • Vite - Fast build tool
  • Ant Design - UI component library
  • Zustand - State management
  • PDF.js - PDF rendering and text extraction
  • pdf-lib - PDF manipulation
  • docx - Word document generation
  • file-saver - File download handling

Development

Prerequisites

  • Node.js 18+
  • pnpm 8+

Installation

pnpm install

Run Development Mode

pnpm run electron:dev

Build for Production

pnpm run electron:build

Builds will be in the release/ directory.

Keyboard Shortcuts

  • Ctrl/Cmd+O - Open PDF file
  • Ctrl/Cmd+S - Save
  • Ctrl/Cmd+Shift+S - Save As
  • Ctrl/Cmd+P - Print

Project Structure

pdf-editor/
├── electron/          # Electron main process
│   ├── main.ts       # Main process entry
│   ├── preload.ts    # Preload script
│   └── ipc/          # IPC handlers
├── src/              # React application
│   ├── components/   # React components
│   │   ├── Layout/   # Layout components
│   │   ├── PDFViewer/# PDF viewing components
│   │   └── Editors/  # Editing components
│   ├── services/     # Business logic
│   │   ├── pdfRenderer.ts  # PDF.js wrapper
│   │   ├── pdfEditor.ts    # pdf-lib wrapper
│   │   └── exportService.ts# Export functionality
│   ├── stores/       # Zustand stores
│   ├── hooks/        # Custom React hooks
│   └── utils/        # Utility functions
├── docs/             # Documentation
└── dist/             # Build output

Roadmap

  • Phase 1: Core Viewer
  • Phase 2: Basic Editing
  • Phase 3: Advanced Editing
  • Phase 4: Advanced Features
  • Phase 5: Complete Feature Enhancement (In Development)

License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages