Convert PDF to POTM in Python

Import PDF pages and save them in the PowerPoint POTM macro-enabled template format with Aspose.Slides for Python via Java.

Convert PDF to POTM in Python

Aspose.Slides for Python via Java can import PDF pages as slides and save the resulting presentation as a POTM file. POTM is the macro-enabled PowerPoint Open XML template format. Because PDF documents do not contain VBA projects, the conversion transfers the page content but does not create macros.

Convert PDF to POTM using Python

Create an empty Presentation, remove its default slide, and call addFromPdf to import the PDF pages. Then call save with SaveFormat.Potm to create the POTM file.

Python code for converting PDF to POTM

presentation = Presentation()
try:
    presentation.getSlides().removeAt(0)
    presentation.getSlides().addFromPdf("document.pdf")
    presentation.save("presentation.potm", SaveFormat.Potm)
finally:
    presentation.dispose()

How to convert PDF to POTM in Python

Follow these steps to import a PDF document and save its pages in the PowerPoint POTM macro-enabled template format.

  1. Install Aspose.Slides for Python via Java .

  2. Configure the package and start the Java Virtual Machine in your application.

  3. Import the PDF pages by calling addFromPdf on the presentation’s slide collection.

  4. Call save with SaveFormat.Potm to create the POTM file.