Skip to content

AroseEditor/Contrary-Better-PDF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📄 Contrary PDF

A high-performance Chrome PDF viewer — fast, modern, with built-in annotations, drawing, text editing, and save-as-PDF.

Author: ayush.ue5


✨ Features

🚀 Viewer Engine

  • 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

🎨 Modern UI

  • Dark & Light themes with smooth transition
  • Glassmorphism toolbar with backdrop blur
  • Collapsible sidebar (thumbnails + PDF outline)
  • AI Assistant panel
  • Drag & drop PDF loading

🖊 Tools

  • 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.pdf with all annotations embedded

🤖 AI Assistant (Mock)

  • Summarize document
  • Explain selected text
  • Ask questions about content

⌨️ Keyboard Shortcuts

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

📦 Installation

Load Unpacked (Developer Mode)

  1. Open chrome://extensions/
  2. Enable Developer mode
  3. Click Load unpacked → select this folder
  4. Open any PDF — auto-redirects to Contrary PDF

Pack for Distribution

Run:

pack.bat

This creates contrary-pdf.zip ready for Chrome Web Store upload.

Enable Local File Access

  1. Go to chrome://extensions/
  2. Find "Contrary PDF" → Details
  3. Enable "Allow access to file URLs"

📁 Structure

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

📜 License

MIT — ayush.ue5

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors