PDF Inverter
PDF dark mode without rasterizing the text
- Role
- Personal project
- Year
- 2025
- Built with
- JavaScript · pdf-lib · HTML
Overview
PDF Inverter is a lightweight, client-side tool that turns PDFs into dark-mode versions while keeping text as real text. Naive inversion breaks on transparent backgrounds and on rasterized elements. This tool rebuilds each page layer by layer with blend modes instead.
Three layers
Each page is rebuilt from three layers. A solid white base fixes transparent backgrounds. The original page content goes on top of it. A final white rectangle in Difference blend mode inverts everything beneath it.
Not crashing
pdf-lib can throw on complex or corrupted documents. Each page is embedded as its own clean copy, so one bad page can't take down the whole file. The tool is one self-contained HTML file: drop a PDF in, preview it, download it.
Tech Stack
- JavaScript
- pdf-lib
- HTML
- Tailwind CSS