Platforms
Frameworks
Languages
Platform Specifics
File format support
Welcome to Apryse. Node.js for the Apryse SDK is supported on Windows, Linux and macOS. To get started, choose your preferred platform from the tabs below.
This guide will help you run Apryse samples and integrate a free trial of the Apryse SDK into Node.js projects on Windows. Your free trial includes unlimited trial usage and support from solution engineers.
Download the SDK
A commercial license key is required for use in a production environment. Please contact sales to purchase a commercial key or if you need any other license key assistance.
License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).
Please note that all Apryse NodeJS libraries install native binaries and installing the package will install a system specific distribution.
If your OS or Node.js version is not supported, the installation will fail.
node_modules/@pdftron/pdfnet-node-samples
folderYou can also enter any individual sample folder to run them separately. For example, here's how to run the AddImageTest
sample:
You can now import the Apryse SDK by using the following in your Node.js code:
At the end of your code, don't forget to call PDFNet.shutdown()
, otherwise your Node.js program will keep hanging.
Here is an example for creating a blank pdf page:
This guide will help you run Apryse samples and integrate a free trial of the Apryse SDK into Node.js projects on Linux or help you set up Apryse SDK serverless AWS Lambda functions. Your free trial includes unlimited trial usage and support from solution engineers.
A commercial license key is required for use in a production environment. Please fill out our licensing form if you do not have a valid license key.
License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).
1. Install the npm package:
Please note that all Apryse NodeJS libraries install native binaries and installing the package will install a system specific distribution.
2. Get your Apryse trial key.
If your OS or Node.js version is not supported, the installation will fail.
1. Open a command line console, and run
2. Change the directory to the node_modules/@pdftron/pdfnet-node-samples
folder
3. Run all samples:
You can also enter any individual sample folder to run them separately. For example, here's how to run the AddImageTest
sample:
Import the Apryse SDK by using the following in your Node.js code:
At the end of your code, don't forget to call PDFNet.shutdown()
, otherwise your Node.js program will keep hanging.
Here is an example for creating a blank pdf page:
In this particular guide, we will demonstrate how to set up an AWS Lambda function to use Apryse SDK using Node.js 14.
First, prepare a zip package with PDFNet-node module embedded and your index.js
.
From the command line, check your node version:
If the version is not 14, please make sure you install the right version before continue. The lastest supported version on AWS Lambda is Node.js 14. If you want to use a different version, make sure that your Node js version and what you use on AWS Lambda function are the same.
From the command line:
Copy your lambda source (i.e. index.js
) to YOUR_FUNCTION_FOLDER
. Your package should include node_modules
folder and index.js
. Then zip your package before uploading it to your AWS Lambda account.
You can now upload YOUR_FUNCTION_FOLDER.zip
to your AWS Lambda.
Second, create a lambda function in your AWS account and upload the zip package:
YOUR_FUNCTION_NAME
] > Runtime [Node.js 14.x] (if your Node js version is 14. Otherwise, choose the one the matches your Node js version from the checking above.) > choose Create FunctionOnce you have followed the initial setup instructions, you can begin calling Apryse SDK APIs in your lambda function source. For example:
You can update node.js script of your AWS Lambda function with the following code or download the source code from our github respository. This snippet shows how to process a request sent from a client to convert an office document to PDF and send the output to client.
After you have uploaded your zip package to your AWS Lambda function and get its API endpoint
in Configuration > Triggers, you can now do a simple test using REST API.
In order to use this 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 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, and see the reponse 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 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:
We have shown how to set an AWS Lambda function using Apryse SDK. You can now experiment making your own functions, URLs, and can fully utilize Apryse SDK. If your have any questions, please don't hesitate to contact us!
This guide will help you run Apryse samples and integrate a free trial of the Apryse SDK into Node.js projects on macOS. Your free trial includes unlimited trial usage and support from solution engineers.
Download the SDK
A commercial license key is required for use in a production environment. Please contact sales to purchase a commercial key or if you need any other license key assistance.
License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).
Please note that all Apryse NodeJS libraries install native binaries and installing the package will install a system specific distribution.
If your OS or Node.js version is not supported, the installation will fail.
node_modules/@pdftron/pdfnet-node-samples
folderYou can also enter any individual sample folder to run them separately. For example, here's how to run the AddImageTest
sample:
Import the Apryse SDK by using the following in your Node.js code:
At the end of your code, don't forget to call PDFNet.shutdown()
, otherwise your Node.js program will keep hanging.
Here is an example for creating a blank pdf page:
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales