A high-performance Chrome PDF viewer — fast, modern, with built-in annotations, drawing, text editing, and save-as-PDF.
Author: ayush.ue5
- PDF.js rendering with virtual scrolling — only visible pages rendered
- Smooth zoom with scroll-position preservation
- Continuous and single-page view modes
- Fast text selection, copy & paste
- Handles large PDFs (100+ pages) without lag
- Dark & Light themes with smooth transition
- Glassmorphism toolbar with backdrop blur
- Collapsible sidebar (thumbnails + PDF outline)
- AI Assistant panel
- Drag & drop PDF loading
- Select — select, copy, paste text
- Highlight — select text to highlight it
- Draw — freehand drawing anywhere (including outside PDF pages)
- Text Box — drag to create, then type
- Eraser — click to remove any annotation
- Undo / Redo with full history
- Save as PDF — exports
filename_edit.pdfwith all annotations embedded
- Summarize document
- Explain selected text
- Ask questions about content
| Shortcut | Action |
|---|---|
V |
Select mode |
H |
Highlight mode |
D |
Draw mode |
T |
Text box mode |
E |
Eraser mode |
Ctrl+S |
Save as PDF |
Ctrl+O |
Open file |
Ctrl+F |
Search |
Ctrl+B |
Toggle sidebar |
Ctrl+Z/Y |
Undo / Redo |
Ctrl++/-/0 |
Zoom in/out/reset |
Ctrl+Scroll |
Mouse wheel zoom |
- Open
chrome://extensions/ - Enable Developer mode
- Click Load unpacked → select this folder
- Open any PDF — auto-redirects to Contrary PDF
Run:
pack.bat
This creates contrary-pdf.zip ready for Chrome Web Store upload.
- Go to
chrome://extensions/ - Find "Contrary PDF" → Details
- Enable "Allow access to file URLs"
Pdf extension/
├── manifest.json # Chrome Extension manifest (v3)
├── background.js # Service worker — PDF interception
├── pack.bat # Builds zip for Web Store
├── src/
│ ├── viewer.html # Main viewer page
│ ├── viewer.js # Orchestrator + shortcuts
│ ├── pdf-engine.js # PDF.js + virtual scrolling
│ ├── annotations.js # Drawing, highlights, text boxes, save
│ ├── ui.js # Toolbar, sidebars, theme, AI
│ └── styles.css # Design system (dark/light)
├── lib/
│ ├── pdf.min.js # PDF.js
│ ├── pdf.worker.min.js # PDF.js worker
│ └── pdf-lib.min.js # pdf-lib (save as PDF)
└── assets/
├── icon16.png
├── icon48.png
└── icon128.png
MIT — ayush.ue5