By Isaac Maw | 2026 Jan 14

7 min
Tags
apryse webviewer
webviewer
node.js
For business, insurance, finance and medical applications, the capability to generate polished, professional PDF documents from given data helps automate workflows and provide better results for end users, letting software spit out invoices, statements, receipts and forms without manual effort. PDF document generation is critical for web platforms to scale and serve more users.
There are two main approaches developers can choose from for implementing PDF document generation in a web application: server-side and client-side (browser-based). Each approach has pros and cons that make each better suited to specific use cases.
In this quick blog, let’s examine the approaches to PDF generation, a few open-source SDK options, and finally what Apryse has to offer.
Node.js is a popular JavaScript runtime environment that allows developers to run javascript code, which is usually used for browser-based applications, on a server. Node.js is a popular option for full-stack development in JavaScript.
As a result of this flexibility, many of the open-source JavaScript PDF generation libraries that developers are familiar with are designed to run client-side in the browser, but can be used server-side by running them in Node.js.
JsPDF is a library to generate PDFs in JavaScript. It allows you to specify the paper size, orientation, or units, and can be a good starting point for advanced functionality such as adding images, charts and paging. JsPDF is primarily designed for client-side use, but it can also be run within a Node.js environment.
Pdf-lib is a library build on PDF.js, a general-purpose, web standards-based platform for parsing and rendering PDFs. Pdf-lib allows developers to create PDF documents from scratch, or modify existing PDF documents. It also supports draw text, images, and vector graphics. According to the website, you can embed your own fonts and embed and draw pages from other PDFs. Like jsPDF, PDF-lib is designed for client-side processing, but it can work within Node.js for server-side use.
PDFKit is a PDF document generation library for Node and the browser. It supports vector graphics, text formatting, forms, fonts, annotations, and more.
If your app is built on Node.js, you can also use the Apryse SDK to generate PDFs. ake a look at how to implement PDF Generation using Node.js and the Apryse SDK
This architectural decision has implications for scalability, performance, and security.
With Server-side processing, the user sends data input to the server, which processes it using the software (including the PDF Generation SDK) to generate the document. The generated PDF is sent back to the client (or wherever it’s needed).
Using client-side processing, the software processes the data and templates locally, such as using javascript frameworks or libraries.
Because each approach to document generation takes place using either the central server’s resources (CPU, memory, etc.), or each user’s local device resources, scalability and performance are key considerations. For example, does the client device (such as company workstations, customer’s mobile devices, or physician’s laptops, for example) have sufficient resources to provide a consistent experience? Will the volume of users requesting PDF generation be too much for the server to handle? Answering these questions will help developers choose the correct approach for performance and scalability.
Processing sensitive data can lead to security vulnerabilities. Because client-side and server-side processing use and transmit sensitive data differently, security and compliance are important considerations, especially for industries managing regulations such as GDPR and HIPAA.
For example, for an online insurance portal, the security of the end user’s device is unknown. Sending sensitive data to the client side may expose sensitive data to malware, unauthorized users or other risks. Instead, processing data on the controlled server and sending the final PDF could be safer.
However, for a platform such as an internal business or healthcare platform, where all the users’ workstations are controlled by your IT department, these risks are minimized, and client-side processing may be preferable.
Server-side PDF generation is often used for batch processing, automated report generation (such as for manufacturing software) and complex, resource-intensive large documents. However, server resources may fall short as load changes, and users may experience latency as documents are generated.
Client-side, browser-based PDF Generation is often used for quick exports from web apps, lightweight forms, reciepts and invoices, and for supporting offline capabilities. Client-side processing can boost scalability since resources automatically meet the number of users, and users enjoy low latency.
One drawback of browser-based processing is that your platform may need to handle different browsers and browser versions your users may be running, unlike the complete control you have over the server-side environment.
What about using a cloud API instead of an SDK? We answer that question in Local SDKs vs. Cloud APIs: What Developers Need to Know Before Building the Next Application
Open-source solutions are a valuable option for adding basic functionality to an application. However, when requirements grow, relying on a growing set of small open-source libraries can present new challenges.
With Apryse, developers can easily build PDF generation workflows in the browser or server-side. Here are the key advantages that make developers choose Apryse:
WebViewer allows you to generate PDFs from DOCX, XLSX, or PPTX templates. Templates can be created in any application, and replaceable content is defined with {{ curly brackets. The data can be merged from any data source in JSON format. Data merging is happening client-side without any server-side dependencies.
To learn how document generation works using WebViewer, you can watch this how to video:
The Server SDK office template generation framework enables the dynamic generation of PDFs:
Open-source libraries are ideal when you need specific document capabilities. However, when a more complete suite of document functionality is required, one vendor that provides end-to-end document processing support may be a better option.
If you’re stuck on a PDF generation problem using Node.js, you can reach out to our Discord for help. Read the document generation documentation for Apryse SDK. You can start your trial today, and if you have any questions, please contact sales.
Tags
apryse webviewer
webviewer
node.js

Isaac Maw
Technical Content Creator
Share this post