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 and samples
This get-started guide explains how to install and use the Apryse Server SDK in a Node.js application. It includes the full Node.js PDF library and sample modules. We'll focus on the OfficeToPDFTest sample to convert Office documents to PDF and demonstrate how to build a simple app for programmatic PDF generation.
Get started video
Get started with the Apryse Server SDK and Node.js on the Windows platform by watching this 4-minute video. You can skip the video and follow the step-by-step instructions instead.
Get started video for Apryse Server SDK and Node.js on Windows
To get started, choose your preferred platform from the tabs below.
In this guide, you'll explore sample PDFNet projects to understand the types of PDF outputs you can create with the Apryse Server SDK. You'll also create a simple Node.js application, add the Apryse Server SDK, and learn how to generate files programmatically.
Before you start:
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.
A commercial license key is required for use in a production environment. Contact sales to purchase a commercial license key.
License keys are uniquely generated and strictly confidential. Don't publish or store them in any public location, including public GitHub repositories.
In this section, you’ll use the OfficeToPDFTest sample to convert a DOCX file to PDF using the Microsoft Office conversion API. You can use this sample to understand how document conversion works and as a reference for your own implementations.
Apryse Node.js libraries include native binaries. During installation, the correct distribution for your system is installed automatically.
2. Install the pdfnet-node-samples library, which contains a collection of sample projects:
3. To add your license key, open this file in Visual Studio Code:
4. Go to the const LicenseKey = ‘YOUR_PDFTRON_LICENSE_KEY’; line and replace the quoted text with your trial license key. Don't change any other information in this file. Save your changes.
LicenseKey.js
5. Navigate to this location, right-click, and select Open in Terminal:
6. In the terminal, add this command to run the sample:
When you run the node OfficeToPDFTest.js command, the sample loads a Microsoft Office document, converts it to PDF, saves the PDF, and outputs the following status messages to the console. For more details, review the OfficeToPDF sample code and the Convert MS Office (Word, Excel, PowerPoint) to PDF overview.
7. Go to this directory to verify that the output PDF files are present:
The folder structure looks similar to:
8. Open the PDF files to see the converted output. The original DOCX files are located in the pdfnet-node-samples\Samples\TestFiles folder.

Converted PDF file showing the output generated from a DOCX document
Create a simple Node.js application that uses the Apryse Server SDK and PDFNet library to generate a PDF programmatically. In this section, you’ll set up a minimal project, add the required code, and run a script that creates a blank PDF document. This example provides a practical foundation for building more advanced document‑generation workflows.
Set up your project by creating a folder and preparing your workspace for the application.
package.json file:A successful output looks similar to:
Next, integrate the Apryse Server SDK into your .NET application and add the code needed to generate a PDF.
1. From the Documents\NewApryseProject directory, install the Apryse SDK:
2. In Visual Studio Code, go to File > New Text File.
3. Paste this code into the text editor, update your license key, and save the file in the Documents\NewApryseProject directory as index.js:
index.js
If you're signed in with an Apryse account, your license key is automatically prepopulated in all code snippets.
With this code, you can:
main function to generate the PDF, while the PDFNet engine handles license initialization and cleanup.Finally, build and run your application to confirm that the Apryse Server SDK is working correctly. After the application runs successfully, it will generate a blank PDF file locally.
A successful output looks similar to:
3. Navigate to the Documents > NewApryseProject folder.
4. Verify the blank output.pdf file was generated programmatically using the Apryse Server SDK:
Now that you've 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.

You can try over fifty samples for the Apryse Server SDK.
To try additional samples, go to section 1. Convert DOCX to PDF > step 6 above and choose another sample to run.
In this guide, you'll explore sample PDFNet projects to understand the types of PDF outputs you can create with the Apryse Server SDK. You'll also create a simple Node.js application, add the Apryse Server SDK, and learn how to generate files programmatically.
Before you start:
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.
A commercial license key is required for use in a production environment. Contact sales to purchase a commercial license key.
License keys are uniquely generated and strictly confidential. Don't publish or store them in any public location, including public GitHub repositories.
In this section, you’ll use the OfficeToPDFTest sample to convert a DOCX file to PDF using the Microsoft Office conversion API. You can use this sample to understand how document conversion works and as a reference for your own implementations.
Apryse Node.js libraries include native binaries. During installation, the correct distribution for your system is installed automatically.
For Alpine Linux, include a target platform specifier to install the correct binaries:
If your OS or Node.js version isn't supported, the installation will fail.
2. Install the pdfnet-node-samples library, which contains a collection of sample projects:
3. To add your license key, navigate to this file and double-click to open:
4. Go to the const LicenseKey = ‘YOUR_PDFTRON_LICENSE_KEY’; line and replace the quoted text with your trial license key. Don't change any other information in this file. Save your changes.
LicenseKey.js
5. Navigate to this location, right-click, and select Open in Terminal:
6. In the terminal, add this command to run the sample:
When you run the node OfficeToPDFTest.js command, the sample loads a Microsoft Office document, converts it to PDF, saves the PDF, and outputs the following status messages to the console. For more details, review the OfficeToPDF sample code and the Convert MS Office (Word, Excel, PowerPoint) to PDF overview.
7. Go to this directory to verify that the output PDF files are present:
The folder structure looks similar to:
8. Open the PDF files to see the converted output. The original DOCX files are located in the pdfnet-node-samples/Samples/TestFiles folder.

Converted PDF file showing the output generated from a DOCX document
Create a simple Node.js application that uses the Apryse Server SDK and PDFNet library to generate a PDF programmatically. In this section, you’ll set up a minimal project, add the required code, and run a script that creates a blank PDF document. This example provides a practical foundation for building more advanced document‑generation workflows.
Set up your project by creating a folder and preparing your workspace for the application.
package.json file:A successful output looks similar to:
Next, integrate the Apryse Server SDK into your .NET application and add the code needed to generate a PDF.
Documents/NewApryseProject directory, install the Apryse SDK:2. In Visual Studio Code, go to File > New Text File.
3. Paste this code into the text editor, update your license key, and save the file in the Documents/NewApryseProject directory as index.js:
index.js
If you're signed in with an Apryse account, your license key is automatically prepopulated in all code snippets.
With this code, you can:
main function to generate the PDF, while the PDFNet engine handles license initialization and cleanup.Finally, build and run your application to confirm that the Apryse Server SDK is working correctly. After the application runs successfully, it will generate a blank PDF file locally.
A successful output looks similar to:
3. Navigate to the Documents > NewApryseProject folder.
4. Verify the blank output.pdf file was generated programmatically using the Apryse Server SDK:
Now that you've 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.

You can try over fifty samples for the Apryse Server SDK.
To try additional samples, go to section 1. Convert DOCX to PDF > step 6 and choose another sample to run.
In this particular guide, we will demonstrate how to set up an AWS Lambda function to use the Apryse SDK with Node.js.
First, you will have to prepare a deployment package with the pdfnet-node module and your Lambda function code (typically named index.js) within it. From the command line:
Now, copy your lambda function code to YOUR_FUNCTION_FOLDER.
It's at this point that it is important to note that the pdfnet-node module must be installed using the same operating system that AWS Lambda will use for its runtime. This is dependent on on the version of Node.js you are using. To see which operating system is required, look here.
We recommend that you use a Docker container to simulate this runtime and have included a Dockerfile to do just that. Create a Dockerfile with the contents below.
Dockerfile
Next, run the following docker commands to generate a deployment package to upload to AWS Lambda. Replace YOUR_IMAGE_NAME_HERE with the image name of your choice, as well as YOUR_NODE_VERSION_HERE as the Node version of your choice. YOUR_NODE_VERSION_HERE as the Node version of your choice. Note that this Dockerfile requires that your AWS Lambda function code file be named index.js, and that it uses your project's package.json and package-lock.json to install dependencies such as the pdfnet-node module you installed in the last step.
After running this Docker container, you should have your deployment package within the ./output directory and can now upload it to AWS Lambda.
Second, create a Lambda function in your AWS account and upload the deployment package:
YOUR_FUNCTION_NAME] > Runtime (matching your Node version) > choose Create FunctionOnce you have followed the initial setup instructions, you can begin calling Apryse SDK APIs in your Lambda function code. For example:
You can update the Node.js script of your AWS Lambda function with the following code or download the source code from our GitHub repository. This snippet shows how to process a request sent from a client, convert an office document to a PDF, and send the output to client.
After you have uploaded your deployment package to AWS Lambda and set its API endpoint in Configuration > Triggers, you can now do a simple test using a REST API.
In order to use the function to convert an office document to PDF, the client needs to POST a REST API request to the server. The request must include JSON data structured as in the code below.
Upon receiving a client's request, a response will be sent back to the client including the base64 encoded PDF output using the same JSON structure. All the client needs to do now is decode the encoded data into a PDF. That's it!
Please review the sample python code. After cloning the repository and installing necessary packages, please refer to /client/README.txt for detailed instructions. Navigate to the client folder, run the following command, see the response to client's request in the console, and check the output in the output folder:
The client will send a REST API request to convert /input/simple-word_2007.docx to a PDF and the server will send back the encoded data, which will then be saved as PDF in the output folder.
You can experiment with your own office document by putting it inside input folder:
In this article, we have shown how to set up an AWS Lambda function using the Apryse SDK. You can now experiment making your own functions, URLs, and can fully utilize the Apryse SDK using AWS Lambda. If your have any questions, please don't hesitate to contact us!
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 macOS platform.
Before you start:
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.
A commercial license key is required for use in a production environment. Contact sales by filling out our licensing form if you want to purchase a commercial license key.
License keys are uniquely generated and strictly confidential. Don't publish or store them in any public location, including public GitHub repositories.
In this section, you can download and run the OfficeToPDFTest PDFNet sample module, which demonstrates the SDK's document-conversion capabilities. Upon successful completion, you can convert a DOCX document to a PDF file while leveraging the MS Office-to-PDF conversion API. You can use this module as a reference implementation when integrating similar document-conversion functionality into your own applications. By running the sample, you can quickly:
Note that all Apryse Node.js libraries install native binaries and installing the package will install a system-specific distribution.
The packages are added:

Install the Node.js PDF library.
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):
The samples are installed:

Install the pdfnet-node-samples.
At the terminal, type exit and press Enter.
Before running the sample, you need to add your license key to the LicenseKey.cs file.
3. Navigate to: home/node_modules/@pdftron/pdfnet-node-samples/LicenseKey.js, right-click and select Open With > Visual Studio Code to open.

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. Do not change any other information in this file. Save your changes and close the file.

Add your license key.
5. Navigate to: home/node_modules/@pdftron/pdfnet-node-samples/OfficeToPDFTest, right-click, and select New Terminal at Folder. The macOS terminal opens.

Open the OfficeToPDFTest sample.
6. From the project directory, in the terminal, enter the following and press Enter to run the sample:
The sample runs:

Run the OfficeToPDFTest 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. In the terminal, type exit, press Enter, and close the terminal window.
8. Navigate to: home/node_modules/@pdftron/pdfnet-node-samples/TestFiles/Output. You will see three output PDF files (Fishermen.pdf, the_rime_of_the_ancient_mariner.pdf, and the factsheet_Arabic.pdf):

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

Open the PDF files to view the converted output.
This section provides steps to create a simple Node.js project that uses the Apryse SDK and the PDFNet library to programmatically generate a blank PDF document. With these steps, you can learn how to set up your environment, import the required libraries, and run a script that produces a valid PDF file—all without manual intervention. This example provides a practical foundation for more advanced document‑generation workflows.
package.json file with default values.A new package.json file is created:

Create a new Node.js project.
5. In the terminal, type exit, press Enter, and close the window.

Open Node.js folder.
2. From the File menu, select NewTextFile and name it index.js.
3. Copy the following code and paste it into the index.js file to create a blank PDF page.
Keep in mind the following about the code above:
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.

Add your trial license key.
5. Save your changes and close the file.
6. You have successfully added the Apryse Server SDK to your Node.js project!
The sample code executes, creates a blank PDF page, and displays the message, “Hello World!”

The sample code runs.
3. Exit out of the terminal 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.

Try out additional samples.
5. To try additional samples, go to section 1. Run a sample > step5 above and choose another sample to run.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales