PDF Architecture
The Portable Document Format (PDF) is notoriously complex, effectively functioning as a programming language (PostScript) compiled for print. Rendering it securely in a browser requires aggressive sandboxing.
The Engine: PDF.js
uViewDoc utilizes a customized, stripped-down build of Mozilla's pdf.js. Rather than relying on standard `
Security Posture
Standard PDFs can contain embedded JavaScript, external network calls, and complex form logic. Our implementation explicitly disables these features:
disableAutoFetchis strictly enforced to prevent network reconnaissance.enableScriptingis set to false. Embedded XSS vectors are neutralized at parse time.- Font rendering relies on local system fonts where possible, failing back to bundled standard fonts to prevent tracking pixels hidden in remote font requests.
Memory Management
For massive architectural drawings (e.g., 50MB+), the engine streams the file via the File API using ArrayBuffer chunks. Progressive rendering ensures the browser thread is not blocked, meaning a 1GB PDF will not crash the tab instantly, though scrolling may degrade depending on available RAM.