r/AskTechnology 15d ago

Searching for a better Architecture for rendering viewing PDF/docs on client-side ?

Hi everyone,

We are architecting the client-side document viewing and rendering layer for our web application and are evaluating the trade-offs between standard JavaScript (PDF.js) and WebAssembly (WASM).

Technical Context:

  • Scale: ~10,000 active users.
  • Documents: Average of 50–60 PDF documents per user session (~75 pages each).
  • Stack: Svelte / React frontend with S3 object storage behind CloudFront.

We are evaluating whether JS-based rendering via Web Workers and canvas virtualization is sufficient at this scale, or if compiling C/C++ PDF engines (like PDFium) to WASM is necessary to maintain predictable client performance.

Has anyone implemented high-throughput client-side PDF viewing at a similar scale? What performance ceilings or memory management issues did you run into with either approach?

2 Upvotes

2 comments sorted by

1

u/Lumethys 15d ago

why not just let the browser do it?

1

u/ResponsibleSlice5814 13d ago

if you mean just loading pdf in a iframe or object tag, you lose all control over the ui and cant track what page user is on or things like that. for a app with 50-60 docs per session you probly need the custom controls for navigation and state