Convert PDF to SWF in Python
Python API for importing PDF pages and exporting them to SWF
Convert PDF to SWF in Python
Aspose.Slides for Python via .NET
lets you convert PDF files to SWF programmatically. The API imports each PDF page as a slide with SlideCollection.add_from_pdf, then exports the presentation with Presentation.save and SaveFormat.SWF.
SWF is a legacy Adobe Flash format intended for compatibility with older workflows and is not supported by modern web browsers. See the presentation import guide for details about importing PDF pages.
Install the library from PyPI by using the following command:
Console/Terminal
pip install aspose-slides
How to Convert PDF to SWF in Python
Follow these steps to convert a PDF file to SWF using Python.
Create a
Presentationand remove its default blank slide.Import the source PDF by using
SlideCollection.add_from_pdf.Save the presentation by using
Presentation.savewithSaveFormat.SWF.
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 SWF in Python
with slides.Presentation() as presentation:
presentation.slides.remove_at(0)
presentation.slides.add_from_pdf("document.pdf")
presentation.save("presentation.swf", slides.export.SaveFormat.SWF)
Save PDF as SWF in Python
Import the PDF pages withSlideCollection.add_from_pdf, then save the presentation with SaveFormat.SWF.Other Supported Conversions
You can also convert PDF to many other file formats. See the supported conversions below.