Tools
PDF viewer
PDFs are reformed by a PDF.js viewer bundled with the browser extension, which redraws each changed word onto the page canvas in its own font and ink color.
Why a custom viewer
Chrome's built-in PDF viewer is a native plugin that content scripts can't touch. So the extension ships its own PDF.js viewer instead. The service worker detects PDF navigations — by .pdf URL suffix, by Content-Type / Content-Dispositionheaders, or by sniffing the leading bytes for %PDF- — and redirects the tab to the bundled viewer.
redirect → src/pdf/viewer.html?file=<original url>
How a page is reformed
- PDF.js renders each page to a
<canvas>. - The invisible text layer is run through the same
walkTextNodes(textLayerDiv, convert)used for web pages. - Each changed word is redrawn onto the canvas in the page's own font, sampling the surrounding ink and paper colors so the reformed word blends in.
Same engine, different surface
The PDF path reuses the exact converter and DOM walker as ordinary pages — the only PDF-specific work is rendering, text-layer extraction, and per-word color sampling (
src/pdf/sample-colors.js). URL detection helpers in src/pdf/pdf-url.js are unit-tested.Printing
Reformed PDFs can be printed or saved; exported files are named <base>.eu.pdf to mark them as the Euspell rendering.