Platforms
Frameworks
Languages
Use our Apryse Server SDK with Python3 and pip3. We include Python examples to integrate Server.
The Apryse Server SDK is cross-platform and supported on Windows, Linux, and macOS. The base package is robust, allowing you to programmatically do the following with PDFs:
If you’re looking for additional capabilities, we offer add-on packages, such as Smart Data Extraction, and add-on modules, such as Office Conversion. For a complete list of add-ons, refer to the following:
Using the Server SDK allows you to build server-side document processing solutions at scale without relying on client devices or cloud APIs. Since the Server runs entirely on-premises (or in your private cloud), you can ensure security and compliance with full control over access, storage, and encryption. You can also easily integrate with web apps, backend systems, document management systems, and content workflows.
This get-started guide explains how to install and use the Apryse Server SDK in a Python application. It includes the full Python 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.
There are two ways to use Apryse with Python:
pip to install third‑party Python packages, such as the Apryse SDK. The SDK is distributed as a precompiled Python library.PDFNet bindings to build your own custom Python wrapper (less common).This guide walks you through getting started with the precompiled Python SDK using pip.
Choose your preferred platform from these tabs.
In this guide, you'll begin by setting up your Python environment. Next, 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 Python 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. Please make sure that it is not publicly available (e.g. in your public GitHub).
Before getting started, ensure that Python and pip are installed. You’ll use pip to install the Apryse Server SDK.
macOS includes a system‑managed Python used by the operating system. For development, install Python via Homebrew and use it inside a virtual environment.
The python3 path should point to Homebrew (for example, /opt/homebrew/bin/python3 or /usr/local/bin/python3). If it points to /usr/bin/python3, you're using the system Python.
2. If Python and pip aren't installed, install them with Homebrew. This command installs the latest Python version with pip:
3. If Python and pip are installed with Homebrew, update Homebrew and Python. This also updates pip:
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.
PDFNetPython3.zip file to unzip it.6. In the terminal, install the Apryse SDK using pip to fetch the package from Apryse's package index. The legacy PDFNetPython3 package on the default Python Package Index (PyPI) is no longer maintained:
Install the Apryse SDK in a virtual environment to ensure it's isolated and installed in a predictable location. When running Python scripts that import apryse-sdk, make sure you activate the same virtual environment first.
If no errors occur, Successfully installed apryse-sdk... displays in the terminal.
7. To add your license, open this file in Visual Studio Code:
8. Go to the 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.py
9. To run the sample, navigate to this folder:
10. Right-click the PYTHON folder and select New Terminal at Folder.
11. In the terminal, run this script:
When you run the RunTest.sh script, the sample code 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.
12. Go to his directory to verify the output PDF files are present:
The folder structure looks similar to:
13. Open the PDF files to see the converted output. The original DOCX files are located in the PDFNetPython3/Samples/TestFiles folder.

Converted PDF file showing the output generated from a DOCX document
Create a simple .NET 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.
HelloWorld.py file at the root of your project.Next, integrate the Apryse Server SDK into your Python application and add the code needed to generate a PDF.
~/Documents/NewApryseProject directory in your terminal, then install the Apryse SDK: Install the Apryse SDK in a virtual environment to ensure it's isolated and installed in a predictable location. When running Python scripts that import apryse-sdk, make sure you activate the same virtual environment first.
A successful output looks like:
2. Open the HelloWorld.py file in Visual Studio Code or your preferred code editor:
3. Add this code to the HelloWorld.py file, update your license key, and save your changes:
HelloWorld.py
If you're signed in with an Apryse account, your license key is automatically prepopulated in all code snippets.
With this code, you can:
PDFDoc object.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.
HelloWorld.py script: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. The folder structure looks similar to:
Now that you've successfully run an OfficeToPDFTest sample (in section 2) and integrated the Apryse Server SDK Python 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 2. Convert DOCX to PDF > Step 11 and choose a different sample to run.
Additional modules are required for some sample functionality, such as OCR, CAD, and PDF-to-Microsoft Office. For more, see Add-on modules for Apryse Server SDK.
You'll install or update pip3 and Python3, then get started with our samples to see the output you can create when you integrate the Apryse Server SDK into your application. Last, you'll create a project and integrate the Server SDK into your Python 3 application, all while using the Windows 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. 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).
You’ll need Python3 in your system. You’ll need pip3 to eventually install the Apryse Server SDK.
2. Complete one of the following based on whether pip3 and Python3 are already installed:
You'll download and run the OfficeToPDFTest sample which allows you to explore and validate the conversion feature offered by the SDK. By running the sample, you can quickly:
Documents, New Folder, then enter ApryseSamples, and press Enter to create a new folder to extract the zip file into for running the samples. You can create a folder at a different location if you prefer, but for this guide’s instructions, we used the location and name above.Downloads folder, right-click on the zip file, then select Extract all.The file is extracted to the folder.
7. Navigate to the folder /Documents/ApryseSamples/Samples/OfficeToPDFTest/Python, right-click on the Python folder, then select Open in Terminal.
8. The Windows terminal opens to the directory you specified. On the command line, enter the following, then press Enter to install the apryse-sdk library from Apryse’s S3 private repository (You need this to run samples successfully):
We recommend running this in a virtual environment, to guarantee the location of where our library will be installed. Henceforth, if our library needs to be imported, be sure to activate the same virtual environment before running a Python script that imports from apryse-sdk.
The PDFNetPython3 library from the default Python Package Index (PyPI) is not used in the code below because it’s no longer being updated. You’ll use the Apryse PyPI instead in the code.
If no errors occur, Successfully installed apryse-sdk... will display in terminal.
9. Navigate via your Windows file explorer to /Documents/ApryseSamples/Samples/LicenseKey/Python/LicenseKey.py and double-click to open so you can add your license key to the LicenseKey.py file before running the sample.
10. Scroll down to the line containing ‘LicenseKey = “YOUR_PDFTRON_LICENSE_KEY”' and replace the words in quotes with the copy of your trial license key. Leave the ‘if LicenseKey ==YOUR_PDFTRON_LICENSE_KEY’ as is with its default text.
11. Save your changes and close the file.
12. To run the sample, navigate, through the Windows file explorer, to the folder you created: /Home/ApryseSamples/Samples/OfficeToPDFTest/Python, right-click on the Python folder, then select Open in Terminal.
13. The Windows terminal opens the OfficeToPDFTest sample. From the project directory, on the command line, enter the following, then press Enter:
When you run the 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 OfficeToPDFsample code and the Convert MS Office (Word, Excel, PowerPoint) to PDF overview.
Once the sample finishes running, you'll see the status Done in the terminal.
14. At the command prompt, type exit, then press Enter.
15. Go to your Windows file explorer and navigate to: /Documents/ApryseSamples/Samples/TestFiles/Output. You will see three output PDF files (Fisherman.pdf, the_rime_of_the_ancient_mariner.pdf, and the factsheet_Arabic.pdf):
16. Open the PDF files to see the converted output. You have successfully run the OfficeToPDFTest conversion sample!
Next, you’ll create your own Python3 project and add the Apryse Server SDK so you can later integrate the Apryse Server SDK into the project and run it.
Documents folder, and add a new folder.NewApryseProject, then press Enter.Next, you’ll open a blank PDF page within your application.
Documents folder from Windows file explorer, then, select the NewApryseProject folder and click Select Folder. The NewApryseProject opens in Visual Studio Code.
3. Create a file in the project named HelloWorld.py.
4. Copy the following Python code and paste it into Line 1 of the HelloWorld.py file, then Save your file:
Keep in mind the following about the code above:
PDFNet using your Apryse license key. Scroll down to the line containing PDFNet.Initialize(“YOUR_LICENSE_KEY”); and replace the words in quotes with the copy of your trial license key. If you’re logged in to Apryse.com, your license key will automatically replace YOUR_LICENSE_KEY in the code above.PDFNet. In this case, with a PDFDoc object.PDF.Terminate which releases any resources in use.5. To test that your code works, run the script in the folder containing HelloWorld.py in the command prompt, then press Enter.
6. The code executes and you will see “PDFNet is running in demo mode.”
7. Exit out of the command line and navigate to the Documents > NewApryseProject folder from Windows file explorer.
8. Open the linearized_output.pdf which you created by integrating the Apryse Server SDK!
9. Now that you have successfully run an OfficeToPDFTest sample and integrated the Apryse Server SDK Python PDF Library into your application, you can try out 50+ samples depending on your needs.
10. To try additional samples, go to section 2. Run a sample > Step 7 above and choose a different sample to run with a different URL path.
Additional modules are required for some samples functionality, For example, OCR, CAD and PDF to Office. You can get these from our additional module downloads page.
You'll install or update pip3 and Python 3, then get started with our samples to see the output you can create when you integrate the Apryse Server SDK into your application. Last, you'll create a project and integrate the Server SDK into your Python 3 application, all while using the Linux 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. 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).
You’ll need Python 3 on your system. You’ll need pip3 to eventually install the Apryse Server SDK.
We used Ubuntu, version 25.10, for creating this guide.
2. Complete one of the following based on whether pip3 and Python3 are already installed:
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:
tar.gz tarball file, then select Extract to...ApryseSamples, and click Create to create a new folder to extract the tarball file into for running the samples. You can create a folder at a different location if you prefer, but for this guide’s instructions, we used the location and name above.The ApryseSamples folder is created and the tarball is extracted to the folder.
5. Navigate to the folder /Home/ApryseSamples/PDFNetPython3/Samples/OfficeToPDFTest/Python, right-click on the Python folder, then select Open in Terminal.
6. The Linux terminal opens to the directory you specified. On the command line, enter the following, then press Enter to install the apryse-sdk library from Apryse’s S3 private repository (You need this to run samples successfully):
The PDFNet Python 3 library from the default Python Package Index (PyPI) is not used in the code below because it’s no longer being updated. You’ll use the Apryse PyPI instead in the code.
or
If no errors occur, Successfully installed apryse-sdk ... will display in terminal.
7. Navigate via your Linux file explorer to /Home/ApryseSamples/PDFNetPython3/Samples/LicenseKey/Python/LicenseKey.py and double-click to open so you can add your license key to the LicenseKey.py file before running the sample.
8. Scroll down to the line containing ‘LicenseKey = “YOUR_PDFTRON_LICENSE_KEY” and replace the words in quotes with the copy of your trial license key. Leave the ‘if LicenseKey ==YOUR_PDFTRON_LICENSE_KEY’ as is with its default text.
9. Save your changes and close the file.
10. To run the sample, navigate, through the Linux file explorer, to /Home/ApryseSamples/PDFNetPython3/Samples/OfficeToPDFTest/Python, right-click on the Python folder, then select Open in Terminal.
11. The Linux terminal opens the OfficeToPDFTest sample. From the project directory, on the command line, enter the following, then press Enter:
When you run the sh RunTest.sh 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 finishes running, you'll see the status Done in the terminal.
12. At the command prompt, type Exit, then press Enter.
13. Go to your Linux file explorer and navigate to: /Home/ApryseSamples/PDFNetPython3/Samples/TestFiles/Output. You will see three output PDF files (Fisherman.pdf, the_rime_of_the_ancient_mariner.pdf, and the factsheet_Arabic.pdf).
14. Open the PDF files to see the converted output. You have successfully run the OfficeToPDFTest conversion sample!
Next, you’ll create your own Python 3 project and add the Apryse Server SDK so you can later integrate the Apryse Server SDK into the project and run it.
Home folder, and select New Folder. Alternatively, press CTRL + Shift + n to display the New Folder modal.NewApryseProject, then click Create./Home/NewApryseProject, right-click on the folder, then select Open in Terminal.apryse-sdk library from Apryse’s S3 private repository (You need this to run your project successfully):The PDFNet Python 3 library from the default Python Package Index (PyPI) is not used in the code below because it’s no longer being updated. You’ll use the Apryse PyPI instead in the code.
or
If no errors occur, Successfully installed apryse-sdk ... will display in terminal.
Next, you’ll open a blank PDF page within your application.
Home folder from Linux file explorer, then, select the NewApryseProject folder and click Open. The NewApryseProject opens in Visual Studio Code.
3. Create a file in the project named HelloWorld.py.
4. Copy the following Python code and paste it into Line 1 of the HelloWorld.py file, then Save your file.
Keep in mind the following about the code above:
PDFNet using your Apryse license key. Scroll down to the line containing PDFNet.Initialize(“YOUR_LICENSE_KEY”); and replace the words in quotes with the copy of your trial license key. If you’re logged in to Apryse.com, your license key will automatically replace YOUR_LICENSE_KEY in the code above.PDFNet. In this case, with a PDFDoc object.PDF.Terminate which releases any resources in use. 5. To test that your code works, run the script in the folder containing HelloWorld.py in the command prompt, then press Enter.
The code executes and you will see PDFNet is running in demo mode.
6. Exit out of the command line and navigate to the Home/NewApryseProject folder from Linux file explorer.
7. Open the linearized_output.pdf which you created by integrating the Apryse Server SDK!
8. Now that you have successfully run an OfficeToPDFTest sample and integrated the Apryse Server SDK Python PDF Library into your application, you can try out 50+ samples depending on your needs.
9. To try additional samples, go to section 2. Run a sample > Step 5 above and choose a different sample to run with a different URL path.
Additional modules are required for some samples functionality, for example, OCR, CAD and PDF to Office. You can get these from our additional module downloads page.
This guide will help you set up Apryse SDK serverless AWS Lambda functions. Your free trial includes unlimited trial usage and support from solution engineers.
In this particular guide, we will demonstrate how to set up an AWS Lambda function to use Apryse SDK.
First, prepare a zip package with apryse-sdk embedded and your lambda_function.py.
From the command line, check your Python3 version. This information will be needed when you create your function later.
From the command line:
Copy your lambda source (i.e. lambda_function.py) to YOUR_FUNCTION_FOLDER. 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 [Python3.x] (Choose the version that matches your Python3 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 python 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!
Access 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!
How to Build Optical Character Recognition (OCR) in Python - 1/16/25
Splitting a PDF Using Python - 9/11/24
PDF to Office Document Conversion Using Apryse and Python - 4/4/24
Generating Documents and Reports from DOCX Templates and JSON using Apryse and Python - 10/9/23
A Guide to PDF Data Extraction Using Apryse SDK and Python - 7/20/23
Adding a Digital Signature to a PDF With the Python SDK - 7/13/23
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales