Learn how to convert PowerPoint PPTX/PPT to PDF in Python: https://blog.aspose.com/2021/12/28/convert-pptx-ppt-to-pdf-python/
Last active
December 28, 2021 09:36
-
-
Save aspose-com-gists/cbc95264bf51d082800eca055e38cc5c to your computer and use it in GitHub Desktop.
Convert PowerPoint PPTX or PPT to PDF in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.slides as slides | |
# Load presentation | |
pres = slides.Presentation("presentation.pptx") | |
# Create PDF options | |
options = slides.export.PdfOptions() | |
# Set PDF password and access permissions | |
options.password = "password" | |
options.access_permissions = slides.export.PdfAccessPermissions.PRINT_DOCUMENT | slides.export.PdfAccessPermissions.HIGH_QUALITY_PRINT | |
# Save PPTX as PDF | |
pres.save("pptx-to-protected-pdf.pdf", slides.export.SaveFormat.PDF, options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.slides as slides | |
# Load presentation | |
pres = slides.Presentation("presentation.pptx") | |
# Create PDF options | |
options = slides.export.PdfOptions() | |
# Set desired compliance and save as PDF | |
options.compliance = slides.export.PdfCompliance.PDF_A1A | |
pres.save("pres-a1a-compliance.pdf", slides.export.SaveFormat.PDF, options) | |
options.compliance = slides.export.PdfCompliance.PDF_A1B | |
pres.save("pres-a1b-compliance.pdf", slides.export.SaveFormat.PDF, options) | |
options.compliance = slides.export.PdfCompliance.PDF_UA | |
pres.save("pres-ua-compliance.pdf", slides.export.SaveFormat.PDF, options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.slides as slides | |
#Load presentation | |
pres = slides.Presentation("presentation.pptx") | |
# Set array of slides positions | |
slides_array = [ 1, 3 ] | |
# Save PPTX as PDF | |
pres.save("pptx-to-pdf-selected-slides.pdf", slides_array, slides.export.SaveFormat.PDF) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.slides as slides | |
# Load presentation | |
pres = slides.Presentation("presentation.pptx") | |
# Convert PPTX to PDF | |
pres.save("pptx-to-pdf.pdf", slides.export.SaveFormat.PDF) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment