c076c481f8ff24797ed49a96d2d2ab0ded0ac438
Comics were capped to viewer width by `.comic-page { max-width: 100% }`, which
made them *look* fit-to-width while the zoom dropdown dishonestly read "100%"
and zoom-in did nothing (the cap clamped it).
- Drop the max-width cap so explicit zoom works (overflow + horizontal scroll)
- ComicRenderer declares defaultScaleOption='page-width'; main.js honors a
renderer's preferred default zoom instead of hardcoding 100% (other formats
unchanged — they fall through to scale 1.0 with no extra re-render)
Now: opens at true fit-width (dropdown shows "Page Width"); 50%–300% all work.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ReaderJS — Universal Document Viewer
A browser-based document viewer that renders PDF, ODF, RTF, DOC, DOCX, Markdown, comic-book archives, and e-books (EPUB/MOBI) natively in the browser — no server, no upload, no conversion. Everything runs client-side; your files never leave your machine.
To give it a try without installing anything, visit the live demo.
Supported Formats
| Format | Extension(s) | Engine |
|---|---|---|
.pdf |
PDF.js (Mozilla) | |
| ODF — Writer, Calc, Impress | .odt .ods .odp .odg |
JSZip + DOMParser |
| Rich Text Format | .rtf |
RTF.js |
| Legacy Word 97–2003 | .doc |
JSDoc |
| Word Open XML | .docx |
mammoth.js |
| Markdown | .md .markdown |
marked |
| Comic Book Archive | .cbz .cbr .cbt |
JSZip (CBZ) + libarchive.js (CBR/CBT) |
| E-book | .epub .mobi .azw3 |
foliate-js |
Features
- PDF.js-inspired UI — sidebar thumbnails, page navigation, zoom, print
- Drag & drop or browse to open files
- Client-side only — documents are never uploaded or transmitted
Running Locally
git clone --recurse-submodules https://github.com/Alpaq92/ReaderJS.git
cd ReaderJS
npm install
npm run dev
Credits
ReaderJS is built on these open-source libraries:
| Library | Author / Source | Role |
|---|---|---|
| PDF.js | Mozilla Foundation | PDF rendering (via pdfjs-dist) |
| JSDoc | Alpaq92 | Binary .doc (Word 97–2003) reading and rendering — pure JS, zero dependencies, clean-room [MS-CFB] / [MS-DOC] implementation |
| mammoth.js | Michael Williamson | .docx (Word Open XML) → HTML conversion |
| RTF.js | tbluemel | RTF document rendering, including EMFJS and WMFJS for Windows metafile graphics |
| JSZip | Stuk | ODF / ZIP container reading |
| jQuery | OpenJS Foundation | DOM utility required internally by RTF.js |
| marked | Christopher Jeffrey et al. | Markdown → HTML parsing and rendering |
| libarchive.js | Nika Begiashvili | CBR/CBT (RAR/TAR) extraction via a WASM build of libarchive — uses libarchive's own BSD-licensed RAR decoder, no UnRAR code |
| foliate-js | John Factotum | EPUB / MOBI / KF8 (AZW3) parsing and paginated rendering |
| Vite | Evan You / Vite contributors | Build tooling and development server |
Submodules (reference / bundled)
| Submodule | Author / Source | Notes |
|---|---|---|
| mozilla/pdf.js | Mozilla | Pinned for worker build |
| Alpaq92/JSDoc | Alpaq92 | Bundled source for .doc rendering |
| dolanmiu/docx | dolanmiu | Reference |
| webodf/WebODF | webodf | Reference |
| tbluemel/rtf.js | tbluemel | Reference |
| markedjs/marked | Christopher Jeffrey et al. | Reference |
| johnfactotum/foliate-js | John Factotum | Bundled source for EPUB/MOBI rendering (pinned commit) |
Gallery
Screenshots are in the gallery/ folder.
License
MIT © 2026 Alpaq92 — see LICENSE
Languages
JavaScript
96.3%
CSS
2%
HTML
1.7%
