COMING SOON: Spring 2025 Release
By Isaac Maw | 2025 Mar 19
5 min
Tags
office conversion
python
Summary: Providing the capability to convert PDF documents back to the original Microsoft Office format, including .docx, .xslx and .pptx is essential for empowering teams for collaboration and productivity on a variety of business tasks. Check out this brief tutorial on how PDF to PowerPoint looks using python and Apryse SDK.
PDFs are a secure, consistent, and shareable format, preserving images and formatting across devices and platforms. However, while PDFs can be edited, it’s much easier and more familiar for many users to edit PowerPoint slides in Microsoft PowerPoint. In addition, PowerPoint offers the presentation features such as animations and transitions that aren’t possible using a PDF of the slides.
Document conversion functionality helps support the needs of users working with PDF and Microsoft Office formats, both of which are useful and prevalent in business environments. Apryse SDK offers a simple, robust way to support PDF to PowerPoint conversion to maintain productivity and avoid bottlenecks caused by document format issues.
Our SDK supports PowerPoint conversion along with .docx and .xslx formats, as part of our PDF to Office Conversion capability.
When choosing any conversion tool, whether it’s an SDK to add the functionality to your application or a third-party conversion service, it’s important to ensure that the conversion accurately retains the layout and formatting of the documents. If the conversion can’t retain the flow and layout of the original file, preserving headers, footers, columns, tables, and other complex formatting of the document, it might create more work than it saves.
To get started with the Apryse Server SDK in Python 2.x, visit our documentation page. The following describes how to get started using the precompiled Python wrappers for 3.x in Windows.
There are THREE steps needed before you can use apryse-sdk library.
Use pip to install apryse-sdk library from Apryse's S3 private repository in terminal. Notice that PDFNetPython3 library from Python Package Index (PyPI) will no longer be updated in the future after the 9.5.0 release.
python -m pip install apryse-sdk --extra-index-url=https://pypi.apryse.com
Or,
pip install apryse-sdk --extra-index-url=https://pypi.apryse.com
If no errors occur, “Successfully installed apryse-sdk ... “ will display in command prompt.
If you run into this error when installing apryse-sdk via pip:
ERROR: Could not find a version that satisfies the requirement apryse-sdk (from versions: none)
ERROR: No matching distribution found for apryse-sdk
It is possible that your Python version is NOT fully compatible. You can check your python version by using the command:
python –version
and make sure your Python version is within 3.5 - 3.11.
Download apryse-sdk Samples and unzip the package.
Get your Apryse trial key. You can generate a trial key on the documentation page for these instructions.
Navigate to the Samples folder. Notice that you will need to update Samples/LicenseKey/PYTHON/LicenseKey.py before you could run Samples.
It is easy to integrate apryse-sdk into your application. After you have installed apryse-sdk via pip, all you need to do is add from apryse-sdk import * to your Python script.
Below is an example called HelloWorld.py:
# You can add the following line to integrate apryse-sdk
# into your solution from anywhere on your system so long as
# the library was installed successfully via pip
from apryse_sdk import *
def main():
# You need to initialize the PDFNet library
# Before calling any PDF related methods
PDFNet.Initialize("YOUR_APRYSE_LICENSE_KEY")
# This example creates a new document
# and a new page, then adds the page
# in the page sequence of the document
doc = PDFDoc()
page1 = doc.PageCreate()
doc.PagePushBack(page1)
# We save the document in a linearized
# format which is the most popular and
# effective way to speed up viewing PDFs
doc.Save(("linearized_output.pdf"), SDFDoc.e_linearized)
doc.Close()
if __name__ == "__main__":
main()
To test that your code works, run the script in the folder containing HelloWorld.py in command prompt:
python.exe -u HelloWorld.py
Once you have successfully run this, you should see an output file in the working directory of this program.
When you download additional modules such as the Structured Output Module (which we'll talk about in a second) be sure to merge the Samples/ directory from the module into the Samples/ directory obtained from the download in Step 2, ensuring that the files the sample code depends on are available.
Now that you have the Server SDK, you can use the Structured Output Module to begin converting PDF files to Microsoft Office, including PowerPoint.
Here’s how to convert PDFs to MS Office (DOCX, XLSX, PPTX) without any external third party dependencies. PDF to PowerPoint is provided on Windows, Linux and Mac.
First, download the Structured Output Module which is an add-on for your Apryse Server SDK.
Next, place it in the directory of your project, in a folder called lib and then reference it in the below sample.
powerPointOutputOptions = PowerPointOutputOptions()
# Optionally convert only the first page
powerPointOutputOptions.SetPages(1, 1)
# Requires the Structured Output module
Convert.ToPowerPoint(filename, output_filename, powerPointOutputOptions)
The above sample code is shown in Python, but the SDK also supports C#, C++, Java, PHP, Ruby, and Go frameworks.
If you’d like to check out the documentation to see the full tutorial, visit our documentation.
Using the Apryse SDK for PowerPoint conversion provides unparalleled rendering quality for any web, mobile or desktop application. It’s secure by design, with no outside dependencies and scales easily without any server-side dependencies like Microsoft Office or LibreOffice for rendering, conversion, or editing PDFs, Microsoft Office, images, videos, and HTML.
If you need help, our team of experienced SDK developers is there to support you through your unlimited trial to the finish line and beyond. Reach out to us on Discord with any questions.
Tags
office conversion
python
Isaac Maw
Technical Content Creator
Share this post
PRODUCTS
Enterprise
Small Business
Popular Content