Skip to content

Instantly share code, notes, and snippets.

@avneeshchaudhary
Last active April 15, 2024 18:20
Show Gist options
  • Save avneeshchaudhary/83fcd36a1ff52f272727239217ae051c to your computer and use it in GitHub Desktop.
Save avneeshchaudhary/83fcd36a1ff52f272727239217ae051c to your computer and use it in GitHub Desktop.
Converts PPTX files to PDF on Mac
import os
def pptx2pdf():
"""
Install unoconv on your system.
"""
for filename in os.listdir(os.getcwd()):
if filename.endswith(".pptx"):
os.system(f'unoconv -f pdf "{os.path.join(os.getcwd(), filename)}"')
print(f"Converted {filename} to {os.path.splitext(filename)[0]}.pdf")
if __name__ == "__main__":
pptx2pdf()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment