Platforms
Frameworks
Languages
This get-started guide explains how to set up your Python environment and install and use the Apryse Server SDK in a Python application. We'll 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.
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.
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:
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 using pip to fetch the package from Apryse's package index: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:
The legacy PDFNetPython3 package on the default Python Package Index (PyPI) is no longer maintained.
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:
2. Navigate to the Documents > NewApryseProject folder.
3. Verify the blank output.pdf file was generated programmatically using the Apryse Server SDK. The folder structure looks similar to:
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.
Before getting started, ensure that Python and pip are installed. You’ll use pip to install the Apryse Server SDK.
2. If Python and pip aren't installed, download any supported Python 3 version and run the installer from your Downloads folder. During installation:
venv.3. If Python and pip are installed, run the following command to update:
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 using pip to fetch the package from Apryse's package index: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:
The legacy PDFNetPython3 package on the default Python Package Index (PyPI) is no longer maintained.
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
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:
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.
Before getting started, ensure that Python and pip are installed. You’ll use pip to install the Apryse Server SDK. We used Ubuntu 25.10 to create this guide.
On Ubuntu, /usr/bin/python3 is the system Python installed via the Advanced Package Tool (apt) package manager. This is expected and safe to use on Ubuntu systems.
2. If Python and pip aren't installed, or you want to ensure they're up-to-date, run:
The commands install Python 3, pip, and the venv module if they aren't already installed, and update them to the latest versions provided by Ubuntu.
On most Ubuntu systems, the universe repository is already enabled. If a package cannot be found, you may need to enable it.
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.
~/NewApryseProject directory in your terminal, then install the Apryse SDK using pip to fetch the package from Apryse's package indexInstall 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:
The legacy PDFNetPython3 package on the default Python Package Index (PyPI) is no longer maintained.
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
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:
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