Hi Folks,
I’ve been working on HEPR (Highly Efficient PDF Renderer), a GPU-first PDF renderer aimed at very large, vector-heavy floorplan PDFs, but it can also handle PDF books with hundreds, or >1000 of pages with ease.
The motivation came from floorplans exported from Revit and similar BIM/CAD tools. These files can be technically valid PDFs, but they often contain huge amounts of vector geometry. In regular PDF viewers, opening them can take a long time, and panning or zooming can become very slow or even crash the viewer.
Most web-based approaches rasterize these PDFs into tiles. That works, but it has tradeoffs: tile generation can be expensive, real-time client-side rasterization can be painful for huge files, and deep zoom eventually becomes blurry unless you generate many zoom levels.
HEPR takes a different approach: it extracts PDF vector data and renders it through WebGL/WebGPU/three.js-friendly GPU paths, so large floorplans can stay sharp while zooming.
It includes:
- WebGL and WebGPU backends
- A three.js
THREE.Groupwrapper - Vector strokes, fills, text, and embedded raster image layers
- Parsed ZIP export/import to skip repeated PDF extraction (much faster to load)
- Nanite-inspired Vector LOD for reducing rendered stroke segment counts based on the camera/view
- GPU text rendering ideas inspired by the work shared at https://wdobbie.com/. Thanks to @wjdobbie for publishing those articles and demos.
Demos:
- Native WebGL/WebGPU demo: Highly Efficient PDF Renderer
- three.js demo: HEPR Three.js Example
npm:
Github repo:
It is still early, and I would especially appreciate feedback from people who have dealt with large architectural PDFs or PDF rendering inside three.js scenes.
