Case Study
Handling Real-World PDF Edge Cases
Next.js · Go · PDF Processing · OCR · Workspace Flow
Executive Summary
Focused on the hard parts of document software: files that break assumptions, operations that fail in subtle ways, and workspace states that need to stay recoverable.
The Problem
- Large files and multi-step workflows made it easy for users to lose progress.
- Different tools needed different file states, which complicated shared routing and workspace logic.
- Crop, OCR, and conversion flows could fail depending on the input document structure.
Architecture & Approach
- 1Shared upload → workspace → download flow
- 2Tool-specific workspace components that isolate logic
- 3State sharing between pages to preserve file context
- 4Backend validation and guarded processing to fail safely
Challenges & Trade-offs
Upload state had to survive navigation across multiple screens
Crop logic needed careful bounds handling to avoid incorrect output
Different document structures produced inconsistent results in conversion and OCR
Outcomes & Results
- More predictable workflows with clearer recovery paths
- Better resilience for messy or unusual input files