Convert PDFs to dark mode for comfortable night reading.
The only PDF inverter that keeps your text searchable.
Other tools (darkpdf, pdfinverter, invert-pdf) just flip colors and destroy text selectability. pdf2dark uses OCR to rebuild a searchable text layer.
| Feature | Others | pdf2dark |
|---|---|---|
| Dark mode conversion | Yes | Yes |
| Text searchable | No | Yes |
| Text selectable/copyable | No | Yes |
| Preserves page dimensions | Some | Yes |
| Simple CLI | Varies | Yes |
Requirements: Python 3.8+, Tesseract OCR
# macOS
brew install tesseract
# Ubuntu/Debian
sudo apt install tesseract-ocr
# Clone and setup
git clone https://github.com/redLocomotive/pdf2dark.git
cd pdf2dark
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
chmod +x pdf2dark./pdf2dark input.pdfOutput: input_DARK.pdf (or input_DARK_1.pdf if exists)
- Renders each PDF page as a high-resolution image
- Inverts colors (white → black, black → white)
- Runs OCR to extract text and positions
- Creates new PDF with inverted image + invisible searchable text layer
The invisible text layer means you can still:
- Search for text (Cmd/Ctrl+F)
- Select and copy text
- Use screen readers
- Output file is larger than original (~10-20x for vector PDFs)
- Photos/images get inverted too
- OCR accuracy depends on source quality
MIT