HTML JPG PDF SVG PPT
  Product Family
PPTM

Convert PDF to PPTM in Python

Python API for importing PDF pages into macro-enabled PowerPoint presentations

Convert PDF to PPTM in Python

Aspose.Slides for Python via .NET lets you convert PDF files to PPTM presentations programmatically. The API imports each PDF page as a slide with SlideCollection.add_from_pdf, then writes the presentation in macro-enabled PowerPoint format with SaveFormat.PPTM.

The conversion requires no Microsoft PowerPoint, Adobe Acrobat, or other presentation software. The PPTM container supports VBA projects, but importing a PDF does not create macros. See the presentation import guide for more details.

Install the library from PyPI by using the following command:

Console/Terminal

pip install aspose-slides

How to Convert PDF to PPTM in Python

Follow these steps to convert a PDF file to PPTM using Python.

  1. Create a Presentation and remove its default blank slide.

  2. Import the source PDF by using SlideCollection.add_from_pdf.

  3. Save the presentation by using Presentation.save with SaveFormat.PPTM.

System Requirements

Before running the Python conversion sample, make sure your environment meets these requirements.

  • Microsoft Windows, macOS, or 64-bit Linux (see the system requirements ).
  • Python 3.5 or later.
  • Aspose.Slides for Python via .NET installed in your environment.
 

This sample code shows how to convert PDF to PPTM in Python

with slides.Presentation() as presentation:
    presentation.slides.remove_at(0)
    presentation.slides.add_from_pdf("document.pdf")
    presentation.save("presentation.pptm", slides.export.SaveFormat.PPTM)
 

Save PDF as PPTM in Python

Import the PDF pages with SlideCollection.add_from_pdf, then save the presentation with SaveFormat.PPTM.

Other Supported Conversions

You can also convert PDF to many other file formats. See the supported conversions below.

PDF TO BMP (Bitmap Image)
PDF TO EMF (Enhanced Metafile Format)
PDF TO FODP (OpenDocument Flat XML Presentation)
PDF TO GIF (Graphics Interchange Format)
PDF TO HTML (Hypertext Markup Language)
PDF TO JPG (JPEG Image)
PDF TO ODP (OpenDocument Presentation)
PDF TO OTP (OpenDocument Presentation Template)
PDF TO PNG (Portable Network Graphics)
PDF TO POT (PowerPoint 97-2003 Template)
PDF TO POTM (Macro-Enabled PowerPoint Template)
PDF TO POTX (PowerPoint Open XML Template)
PDF TO PPS (PowerPoint 97-2003 Slide Show)
PDF TO PPSM (Macro-Enabled PowerPoint Slide Show)
PDF TO PPSX (PowerPoint Open XML Slide Show)
PDF TO PPT (PowerPoint 97-2003 Presentation)
PDF TO PPTX (PowerPoint Open XML Presentation)
PDF TO SVG (Scalable Vector Graphics)
PDF TO SWF (Shockwave Flash Format)
PDF TO TIFF (Tagged Image File Format)
PDF TO XPS (XML Paper Specification)