A lightweight, self-hosted PDF viewer with red/greenlining annotations, designed for viewing EPLAN schematics and similar technical PDFs directly in the browser.
The viewer runs fully client-side (no server needed) and can be hosted on GitHub Pages or any static web host.
- PDF.js v3 rendering — crisp, zoomable technical drawings
- Red/Greenlining tools:
- Freehand pen (red or green)
- Rectangles (red or green)
- Inline text notes (gold)
- Pan & zoom for large drawings
- Undo / Clear / Save / Load
- Export / Import annotations as JSON
- Share links — annotations are embedded in the URL hash using LZ-String compression
Anyone opening the link sees the same markup (no backend required) - Local autosave — annotations are saved in
localStoragewhen not using a shared link - Offline-first — runs entirely in the browser, no login or internet connection needed
.
├── index.html # Main viewer page
├── viewer.js # Viewer logic (PDF rendering + annotations)
├── viewer.css # Styling (black + gold theme)
├── docs/
│ └── project.pdf # Example EPLAN PDF to view
└── assets/
└── logo.png # Optional logo
git clone https://github.com/AlbertjanPieffers/EKN_EplanViewer.git
cd EKN_EplanViewerPut your EPLAN or other PDFs in docs/ and set PDF_URL in viewer.js:
const PDF_URL = "./docs/project.pdf";Use any static HTTP server (not file:/// URLs).
For example with npx:
npx http-server .Then open:
http://localhost:8080
- Push your code to GitHub
- Go to Settings → Pages
- Under Build and deployment, set:
- Source:
Deploy from a branch - Branch:
main/ folder:/ (root)
- Source:
- Save and wait a few seconds
- Visit your site at:
https://<your-username>.github.io/<repo-name>/
- Click Share link — it copies a URL with
#ann=...hash - Send the link to anyone — they will see your red/greenlining
- If they edit, they must click Share link again to create a new link
Note: Shared links are read-only (they don’t overwrite local annotations).
| Browser | Status |
|---|---|
| Chrome / Edge / Brave / Opera | ✅ Supported |
| Firefox | ✅ Supported (slightly slower on large PDFs) |
| Safari |
MIT License — free for personal, educational, or commercial use.
Attribution is appreciated but not required.
- Add ellipse, arrow, or highlighter tools
- Allow switching between multiple PDFs
- Optional Supabase backend to sync annotations between users