How ul2imate/pdf-editor works
This is a browser-based PDF editor. The main workflow is selecting a PDF, opening it in the editing workspace, rendering and annotating pages, then downloading an exported document. The sampled code shows the app shell, file selection, canvas editing and export path; the README documents additional editing capabilities whose implementation details were not sampled. An optional backend text-extraction call is present, although the product is described as local-first.
Main entry points: canvas.tsx PDF canvas · App.tsx App and routing · mainPage.tsx PDF selection · controls.tsx Page controls
Components 14
Document ingestion
- PDF selection
src/components/mainPage.tsx
Editing workspace
- App and routing
src/App.tsx - PDF canvas
src/components/canvas.tsx - Page controls
src/components/controls.tsx - PDF.js
Editing capabilities
- Fabric canvas
- In-place text editing
src/components/canvas.tsx - Drawing and shapes
src/components/canvas.tsx - Annotation properties
src/components/setting.tsx - Text extraction API
src/services/api.ts
Export
- PDF export
src/utils/pdfExport.ts - Browser download
src/utils/pdfExport.ts
Other components
- User
- Optional backend
Connections 15
- User → PDF selection: selects PDF
- PDF selection → App and routing: sets file and URL
- App and routing → PDF canvas: opens editor
- App and routing → Page controls: renders controls
- Page controls → App and routing: invokes navigation and export
- PDF canvas → PDF.js: loads and renders PDF
- PDF canvas → Fabric canvas: creates annotations
- PDF canvas → In-place text editing: manages text edits
- PDF canvas → Drawing and shapes: manages vector marks
- Annotation properties → Fabric canvas: updates selected objects
- PDF canvas → Text extraction API: requests extraction
- Text extraction API → Optional backend: posts PDF
- PDF canvas → PDF export: passes edits and annotations
- PDF export → Browser download: creates PDF download
- Browser download → User: delivers file