Page Streaming
Markdown, the Moment It's Ready
Most document APIs make you wait for the entire file to finish parsing. Flense streams each page's markdown as it completes — so your app can start rendering, indexing, or processing immediately.
How It Works
Per-Page Delivery
Each page's markdown is delivered the moment it finishes parsing — no waiting for the full document
Concurrent Processing
Pages are processed in parallel across workers, dramatically reducing total parse time
SSE-Based Streaming
Built on Server-Sent Events for reliable, real-time delivery with automatic reconnection
Why It Matters
Quick Start
Enable with One Method Call
Page streaming is built into the Flense SDK. Chain .withPageStreaming() onto any parse call, then subscribe to receive pages as they finish.
- Fluent builder API
- React hook included (
useParseJob) - Progress, content, and completion callbacks
- Works with parseFile and parseUrl
const job = flense
.parseFile(file, 'report.pdf')
.withPageStreaming();
job.subscribe({
onProgress: ({ progress, currentPage, totalPages }) => {
console.log(`${progress}% — page ${currentPage}/${totalPages}`);
},
onContent: ({ page, content }) => {
// Render or index this page immediately
console.log(`Page ${page} ready`);
},
onComplete: (status) => {
console.log(status.output?.markdown);
},
});Use Cases
Live Document Previews
Render markdown in your UI page-by-page as the document is processed. Users see content appearing in real-time instead of staring at a spinner.
Streaming RAG Ingestion
Feed pages into your vector database or embedding pipeline as they arrive. Start retrieval before the full document finishes parsing.
Progress Dashboards
Build rich progress UIs with page-level granularity. Show estimated time remaining, current page, and average page processing time.
Large Document Processing
Process 100+ page documents without timeouts. Concurrent page processing means total time scales sub-linearly with page count.
See It in Action
Upload a multi-page document in our demo and watch the markdown stream in page-by-page.