Skip to content

rolniuq/pdf-darker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Editor

A comprehensive PDF editing tool with dark mode conversion and advanced editing capabilities.

Features

  • Dark Mode Conversion: Convert PDFs to dark theme (black background, white text)
  • Page Manipulation: Rotate, delete, reorder pages
  • Text Operations: Add, replace, highlight text
  • Image Operations: Insert and manipulate images
  • Batch Processing: Process multiple files
  • Rich CLI: Beautiful command-line interface with progress bars
  • Configuration Management: Flexible YAML-based configuration

Quick Start

Installation

  1. Install system dependencies:

macOS:

brew install poppler

Ubuntu/Debian:

sudo apt-get install poppler-utils

Windows: Download and install poppler from poppler releases

  1. Install Python dependencies:
pip install -r requirements.txt
pip install -e .

Basic Usage

Dark Mode Conversion

python main.py dark-mode input.pdf output_dark.pdf --dpi 300 --quality 95

Page Rotation

python main.py rotate input.pdf output.pdf --page 0 --angle 90

Add Text

python main.py add-text input.pdf output.pdf --page 0 --text "Hello World" --x 100 --y 100

Delete Pages

python main.py delete-pages input.pdf output.pdf --pages "0,2,5"

Document Info

python main.py info input.pdf

Configuration

python main.py config-show
python main.py config-set dpi 200

Legacy Usage (Backward Compatible)

For simple dark mode conversion, you can still use the original command:

python init.py input.pdf output_dark.pdf

Project Structure

darker-pdf/
├── src/pdf_editor/          # Main package
│   ├── core/               # Core classes and abstractions
│   ├── operations/         # PDF editing operations
│   ├── cli/               # Command-line interface
│   ├── utils/             # Utilities (logging, validation)
│   └── config/            # Configuration management
├── tests/                 # Test suite
├── docs/                  # Documentation
├── examples/              # Usage examples
└── init.py               # Legacy dark mode converter

Development

Running Tests

pytest

Code Quality

black src/ tests/
ruff check src/ tests/
mypy src/

Configuration

The tool uses YAML configuration files. Create ~/.pdf_editor_config.yaml:

dpi: 300
quality: 95
compression: true
output_dir: "./output"
backup_enabled: true
log_level: "INFO"

Roadmap

See docs/roadmap.md for the complete development plan.

Phase 1: Foundation ✅

  • Modular project structure
  • Configuration management
  • Logging system
  • Rich CLI interface
  • Error handling and validation

Phase 2: Basic Editing 🚧

  • Enhanced text operations
  • Advanced page manipulation
  • Image processing
  • Batch operations

Phase 3: Advanced Features 📋

  • OCR integration
  • Form operations
  • Security features
  • Annotation system

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages