
Create PDFs from Scratch
Document Solutions for PDF JS (DsPdfJS) is a JavaScript library that enables developers to programmatically generate, modify, and export PDF documents directly within modern web applications. Built on a high-performance WebAssembly-based API, developers can initialize new documents using the PdfDocument class and configure settings such as page size, PDF/A compliance, and font embedding through the PdfDocumentOptions interface. This flexible setup allows applications to create standards-compliant PDFs tailored to specific document requirements.
The library also provides comprehensive APIs for building and managing document content. Developers can add images, attach embedded files, or combine dynamically generated pages with existing PDFs using PdfDocument.load(). These capabilities support common workflows such as automated report generation, document assembly, and dynamic contract creation.
Once the document is complete, the PdfDocument.savePdf() method exports the final PDF as a binary array that can be downloaded, stored, or sent to a backend service. Output options such as linearized PDF support help optimize documents for fast web viewing. With these features, DsPdfJS enables powerful PDF generation and processing entirely in the browser.







