Scheduled Maintenance
-
February 10, 2026, from 8:00 AM to 9:00 AM PST. Account-related operations might be temporarily unavailable.

Get Started with the Apryse Server SDK Node.js PDF Library Integration

The Apryse Server SDK delivers powerful, high-quality document processing for your backend infrastructure, is cross-platform, and supported on Windows, Linux, and macOS. Our sophisticated library provides advanced rendering, conversion, and manipulation capabilities for popular formats, including PDF, MS Office, CAD, and various image types. Automate complex workflows, like server-side generation, batch conversion, merging, or pre-processing documents, without relying on client-side tools.

By managing all document services on your servers, you gain complete control, compliance, and security over your data. Integrate this fully-featured server SDK to build scalable, high-performance applications with superior document functionality out-of-the-box.

The Apryse Server SDK base package is scalable, allowing you to easily embed   document processing into your backend applications. If you’re looking for additional capabilities, we offer add-on packages, such as Smart Data Extraction, and add-on modules, such as Digital Signatures and Office Conversion.

Steps & samples

This guide walks you through steps to integrate the Apryse Server SDK free trial into your project. We’ll use a Node.js project as our example project throughout this guide. By the end, you’ll have built an "Apryse Hello World" within your application and be able to open, save, and close a PDF Doc.

Get started video

Get started with the Apryse Server SDK on the Windows platform via the following video. If you wish, you may skip this section and follow the steps below to get started.

Get started video for Apryse Server SDK on the Windows platform

To get started, choose your preferred platform from the tabs below.

You'll get started with our samples to see the output you can create when you integrate the Apryse Server SDK into your Node.js projects. You'll also create a project and integrate the Server SDK into your Node.js projects, using the Windows platform.

Prerequisites

Before you start:

License Key

Apryse collects some data regarding your usage of the SDK for product improvement.

If you wish to continue without data collection, contact us and we will email you a no-tracking trial key for you to get started.

Run Apryse SDK in production.

A commercial license key is required for use in a production environment. Please contact sales by filling out our licensing form if you want to purchase a commercial license key.

Keep your commercial license key confidential.

License keys are uniquely generated. Please make sure your key is not publicly available (e.g. in your public GitHub).

1. Run a sample

First, you’ll download and run the OfficeToPDFTest sample which allows you to explore and validate the conversion features offered by the SDK. By running the sample, you can quickly:

  • Verify the capabilities.
  • Understand how to interact with the MS Office to Conversion PDF API.
  • Use it as a reference for integrating similar functionality into your own application.

Note that all Apryse Node.js libraries install native binaries and installing the package will install a system-specific distribution.

  1. Open your Windows terminal and on the command line, enter the following and press Enter to install the Apryse Node.js PDF library for Windows:

Bash

1npm i @pdftron/pdfnet-node

The packages are added:

Apryse Docs Image

On the command line, install the npm package.

2. Enter the following and press Enter to install the pdfnet-node-samples (they are not included in the pdfnet-node package above and must be downloaded separately):

Bash

1npm i @pdftron/pdfnet-node-samples

The samples are installed:

Apryse Docs Image

Install the samples.

At the command prompt, type exit and press Enter.

Before running the sample, you need to add your license key to the LicenseKey.cs file.

3. In File Explorer, navigate to: C:\Users\YourName\node_modules\@pdftron\pdfnet-node-samples\LicenseKey\LicenseKey.js and double-click to open.

Apryse Docs Image

Open the LicenseKey.js file.

4. Scroll down to the line containing const LicenseKey = ‘YOUR_PDFTRON_LICENSE_KEY’; and replace the words in quotes with the copy of your trial license key you generated when you completed the Prerequisites instructions above. Save your changes and close the file.

Apryse Docs Image

Enter your license key.

5. Navigate to the folder C:\Users\YourName\node_modules\@pdftron\pdfnet-node-samples\OfficeToPDFTest, right-click, and select Open in Terminal. The Windows terminal opens.

Apryse Docs Image

Navigate to the OfficeToPDFTest folder and open in the terminal.

6. From the project directory, on the command line, enter the following and press Enter to run the sample:

Bash

1node OfficeToPDFTest.js

The sample runs:

Apryse Docs Image

Run the sample.

When you run the node OfficeToPDFTest.js command, the sample code loads an Office document, converts the Office document to PDF, saves the resulting PDF, and outputs status messages to the console. For more details, you can look at additional OfficeToPDF sample code and the Convert MS Office (Word, Excel, PowerPoint) to PDF overview.

Once the sample has finished running, you will see Done in the terminal.

7. At the command prompt, type exit, press Enter, and close the terminal window.

8. In File Explorer, navigate to C:\Users\YourName\node_modules\@pdftron\pdfnet-node-samples\TestFiles\Output. You will see three output PDF files (Fisherman.pdf, the_rime_of_the_ancient_mariner.pdf, and the factsheet_Arabic.pdf):

Apryse Docs Image

Navigate to the output folder.

9. Open the PDF files to see the converted output. You have successfully run the OfficeToPDFTest conversion sample!

Apryse Docs Image

Open the OfficeToPDFTest sample!

2. Create your own new project

  1. In File Explorer, navigate to the Documents folder and create a New Folder.
  2. Enter the folder name, NewApryseProject.
  3. Right-click on the NewApryseProject folder and select Open in Terminal.
  4. From the project directory, on the command line, enter the following and press Enter to initialize a new Node.js project and create a package.json file with default values.

Bash

1npm init -y

A new package.json file is created:

Apryse Docs Image

A new project is created.

5. At the command prompt, type exit, press Enter, and close the window.

3. Initialize and integrate the Apryse Server SDK into your application

1. Open Visual Studio Code, select File >Open Folder. Navigate to Document > NewApryseProject and click on Select folder.

Apryse Docs Image

Open the NewApryseProject folder.

2. From the File menu, select NewTextFile... and name it index.js.

3. Copy the following code and paste into the index.js file to create a blank pdf page.

JavaScript

1console.log("Hello World from Node.js!");
2
3const { PDFNet } = require('@pdftron/pdfnet-node'); // you may need to set up NODE_PATH environment variable to make this work.
4
5const main = async () => {
6 const doc = await PDFNet.PDFDoc.create();
7 const page = await doc.pageCreate();
8 doc.pagePushBack(page);
9 doc.save('blank.pdf', PDFNet.SDFDoc.SaveOptions.e_linearized);
10};
11
12// add your own license key as the second parameter, e.g. in place of 'YOUR_PDFTRON_LICENSE_KEY'.
13PDFNet.runWithCleanup(main, 'YOUR_PDFTRON_LICENSE_KEY')
14 .catch((error)=> {
15 console.log('Error: ' + JSON.stringify(error));
16 })
17 .then(()=> {
18 PDFNet.shutdown();
19 });

4. Scroll down to the line containing PDFNet.runWithCleanup(main, ‘YOUR_PDFTRON_LICENSE_KEY’) and replace the words in quotes with the copy of your trial license key.

Apryse Docs Image

What your index.js should look like now.

5. Save your changes and close the file.

6. You have successfully added the Apryse Server SDK to your Node.js project!

4. Run your project

  1. In File Explorer, navigate to the Documents folder. Select the NewApryseProject folder, right-click and select Open in Terminal.
  2. From the project directory, on the command line, enter the following, then press Enter:

Bash

1node index.js

The code executes and you will see the message, “Hello World!

Apryse Docs Image

You will see "Hello World!"

3. Exit out of the command line and navigate to the Documents > NewApryseProject folder.

4. Open the blank.pdf which you created by integrating the Apryse Server SDK!

Now that you have successfully run an OfficeToPDFTest sample and integrated the Apryse Server SDK Node.js PDF Library into your application, you can try out 50+ samples depending on your needs:

Apryse Docs Image

Browse and try out additional samples.

6. To try additional samples, go to section 1. Run a sample > step5 above and choose another sample to run.

Next Steps

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales