study-planner icon indicating copy to clipboard operation
study-planner copied to clipboard

Add different file formats for doc type

Open e-caste opened this issue 5 years ago • 1 comments

Other than .pdf, add .pptx, .ppt, .doc, .docx, etc...

e-caste avatar Aug 16 '20 19:08 e-caste

For .pptx python-pptx seems the best choice, but it fails to open any older .ppt file. Luckily it looks like these guys have worked it out quite well for .ppt files.

Example of working code on Windows:

import aspose.slides as slides
import os

def print_number_of_slides_with_aspose_slides(file_name):
    prs = slides.Presentation(file_name)
    print(f"Presentation '{file_name}' has {len(prs.slides)} slides.")


for file in os.listdir("ppt"):
    print_number_of_slides_with_aspose_slides(os.path.join("ppt", file))

The issue here is that at https://docs.aspose.com/slides/python-net/features-overview/ we read:

The platforms Aspose.Slides for Python via .NET can be used on Windows x64 or x86 and wide range of Linux distributions with Python 3.5 or later installed.

so no macOS support (pip outputs ERR: Could not find a version that satisfies the requirement aspose.slides (from versions: none)

e-caste avatar Apr 26 '22 21:04 e-caste