Skip to main content
Back to Work

Native PDF rebuild in 6 weeks.

6wk

iframe to native

Sprint · 6 weeks · 2025

criaai.app.br

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.

The Outcome

iframe→native
PDF stack rebuilt
react-pdf
+ pdfjs canvas pipeline
1
state machine for page navigation

iframe PDF viewer with broken highlightscustom react-pdf canvas pipeline

Lawyers annotate documents at native-app responsiveness in the browser. Highlights stay locked to the document. Zoom scales without flicker. Page tracking handles scroll and manual jumps as a single coherent state. Edge cases that took the previous viewer down are now first-class behaviors.

Start a similar project.

Talk to us