The Problem
CriaAI's RedatorContencioso writes legal documents with AI — and lawyers need to annotate, highlight, and track pages while drafting. The previous viewer rendered PDFs in an iframe. Highlights misaligned. Page tracking broke on scroll. Zoom flickered. Each fix made the next worse.
Lawyers don't have patience for janky tools. The product needed pixel-accurate highlighting, smooth page navigation, and a zoom that didn't fight the user — across documents from a few pages to a few hundred. iframe-based rendering couldn't deliver any of that consistently.
The Approach
Fixed-scope sprint focused on the PDF interaction layer. We replaced the iframe with a custom react-pdf + pdfjs pipeline rendering at the canvas level. Highlight overlays attach to the document, not the viewport. Page tracking unifies scroll and manual input behind a single state machine.
Next.js 15 (Turbopack) with React 18, TypeScript strict, Redux Toolkit for document state, Firebase for auth and persistence, Formik + Yup for form validation. The result: a viewer that responds to user intent the way native apps do.
Start a similar project.
Talk to us