Isaac Maw
Technical Content Creator
Updated February 04, 2026
6 min
Isaac Maw
Technical Content Creator

Generating PDF documents with dynamic data, such as database or customer input data, is tricky. Find out key considerations to evaluate Apryse SDK against other options, including jsPDF, HTML-to-PDF workflows, and API services to find the best solution for your Node.js application.
To generate PDF documents with dynamic data, such as from a database, user input, forms, or calculations, you need a solution that uses a template and JSON data to create a PDF document that reflows text to match the input data, and meets your specific style and branding requirements.
This article will help you find the right document generation workflow that meets your needs, from the most basic internal-facing report to a complex, polished multi-page document, all done on the backend in your Node.js application.

Creating PDF documents for dynamic data is essential for a number of common software workflows, such as:
This is a popular technique for generating PDFs with dynamic data, but in practice, it can feel more like a hack or a workaround. Essentially, the idea is this:
One issue with this workflow is latency and scalability, since using a browser like Chromium for this purpose can be resource-hungry. While a document generation SDK can generate a PDF in milliseconds, HTML-to-PDF could take 3-30 seconds to output a complex document. In addition, updates to Chromium can break your automation, requiring ongoing fixes and maintenance.
Another issue is with converting HTML to a PDF of sufficient quality. HTML is designed for fluid, responsive experiences, but PDFs are structured and paginated. HTML may not support headers, footers, margins and page breaks properly, depending on your needs.

In this screenshot, a HTML webpage (left) is fluid. When it’s printed to PDF (right), Chrome automatically adds unwanted information to headers and footers. In addition, there are spacing differences, font differences, and body text in the “Get Started” section is cut off by the page break.
There are many innovative, easy-to-use open-source libraries for PDF generation that work with Node.js. For example, jsPDF and PDFKit are two popular options. These solutions are great when you need simple PDF files, but lack advanced features for creating professional documents, high-quality rendering, and predictable output at scale.
Another approach for PDF generation is to send dynamic data to a third party, and get a PDF back. However, this approach comes with drawbacks such as licensing, security and compliance constraints, and limited customizability.
The first option is Apryse Server SDK. Our SDK allows you to own the full document and data lifecycle by deploying on your own infrastructure without worrying about third-party server dependencies.
With the Apryse SDK, Template Generation allows you to generate PDFs or MS Office documents from dynamic data, using a MS office template (such as DOCX) and JSON data. Input data is automatically styled according to the template, and content reflows automatically according to the length of the input data. Headers, footers and other layout elements are easy to customize and tweak to match your document needs. Document Generation also supports advanced features such as form fields and digital signatures. Visit our capabilities page to learn more.
You can get your free trial of the Apryse SDK today and generate whatever documents you want with an Apryse watermark. Get your trial key here.
No matter what type of document you are looking to generate, there are several important things to consider before you pursue a specific workflow.
If generating a PDF document is a primary workflow in your application, such as a transaction receipt or event ticket, the application requires a different scale of PDF generation compared to an application that uses PDF generation less often, such as a medical data portal which offers PDF export as an option.
Whyit’s important: Open-source libraries or workarounds such as HTML-to-PDF conversion may not perform well at scale, while on the other hand, API services and commercial SDKs may offer licensing tiers based on scale.
If you’re building a way for an internal application to spit out a basic report and archive it, you may not need generated documents to look fancy.
However, for customer-facing documents such as tickets, invoices or marketing materials, you’ll need the ability to fine-tune styles, layout, fonts, and images.
Whyit’s important: Open-source libraries don’t always support complex styling features such as fonts, colors and images, and don’t always render high-quality documents. While HTML-to-PDF conversion workflows are often used because HTML and CSS allow for fine control over styling, HTML is designed for fluid, responsive documents while PDFs are rigid and paginated, so conversion isn’t always smooth and reliable. In addition, specific fonts you may require for branding may not be available to embed in your HTML document. Fonts that may encounter issues include Adobe fonts, Monotype fonts (such as Gotham and Futura) and more.
For pixel-perfect documents, Apryse offers superior rendering quality, as well as fine-tuned control over PDF features such as headers and footers.
Apryse document generation supports not only PDF output, but also Microsoft Office formats. That means you can easily meet evolving product requirements without additional developer overhead.
Whyit’s important: If your team builds a reliable PDF generation workflow using third-party API services or open-source JavaScript libraries, and your product requirements later change to include Office document generation such as XLSX, DOCX or PPTX, you may be back to the drawing board. With Apryse, you can change one line of code and have your solution.
Using third-party document generation services via API may be a fast solution for generating your documents, but it may not meet the compliance requirements of your application or your customers. When PDF documents are generated using dynamic data via an external API, that means potentially sensitive data (such as financial, education or medical data) must pass through third-party servers. In addition, your document generation functionality will rely on third-party server uptime.
Secondly, open-source libraries may contain security vulnerabilities, especially older libraries that are not regularly maintained. Even if your chosen library is well maintained now, there’s no guarantee that updates and commits will continue for the life of your product.
Whyit’s important: Your customers may need to know where their sensitive data is going for compliance and security purposes. If your document generation solution relies on a third-party API, you may need to keep track of SLAs for uptime and performance.
There are a number of solutions to generate PDF documents from dynamic data, but they all have different maintenance requirements and offer different levels of stability for your application.
Whyit’s important: Different organizations and teams have different appetites for risk and maintenance. This consideration is especially relevant for HTML-to-PDF conversion workflows, which rely on tools such as headless Chromium. If Chromium changes in a future update, it could break your workflow and set you back.
In addition, using or forking an open-source library requires regular maintenance as well. Commercial SDKs, such as Apryse, require the least maintenance. Apryse includes regular releases, bug fixes, and updates to keep your application running reliably.
Having comprehensive and easy-to-understand documentation and support resources reduces developer overhead and speeds time to market. Apryse offers demos, sample code, human support agents and detailed get-started guides in our documentation to get you up and running faster.
Why it matters: Open-source solutions are well documented for common use cases, but if you’re doing something a little unique, it can be hard to find support. Commercial SDKs are often feature-rich, meaning if documentation isn’t comprehensive and clear, getting up and running can be complex.
We’ve reviewed a lot of information about PDF generation workflows. Here’s the key takeaway:
If you’d like to get a trial key and start generating PDFs directly in your Node.js application (with an Apryse watermark), here’s how:
To get started, you’ll first need to set up Apryse Server SDK using the Node.js integration. Instructions for getting started can be found in our documentation. You can also watch the tutorial video for step-by-step instructions for using Apryse SDK in Node.js:
Apryse's office template generation framework enables the dynamic generation of PDFs:
The generation framework requires minimal code to get up and running. Simply initiate a normal Office conversion, but with the optional TemplateParamsJson parameter set:
You can also try the browser-based demo of our template generation SDK in our Showcase. For more information about licensing, please contact sales.
Server-side PDF generation using an SDK
async function main() {
const options = new PDFNet.Convert.OfficeToPDFOptions();
// Create a TemplateDocument object from an input office file.
const templateDoc = await PDFNet.Convert.createOfficeTemplateWithPath(inputPath, options);
// Fill the template with data from a JSON string, producing a PDF document.
const pdfDoc = await templateDoc.fillTemplateJson(jsonDataString);
// Save the PDF to a file.
await pdfDoc.save(outputPath, PDFNet.SDFDoc.SaveOptions.e_linearized);
}
PDFNet.runWithCleanup(main);