scanny / python-pptx

Create Open XML PowerPoint documents in Python
MIT License
2.41k stars 522 forks source link

feature: update app.xml properties on Presentation.save() #105

Open minamaistay opened 10 years ago

minamaistay commented 10 years ago

Hi, Thanks for this amazing module.

I have noticed that if I:

  1. Open an existing 1 page PPTX (previously created by Microsoft powerpoint)
  2. Add pages to it via python-pptx.
  3. Save the new PPTX.
  4. Email the PPTX to a gmail account.

The preview of the PPTX via gmail only recognises file as having 1 page, so you can't preview past the first page.

However, downloading the PPTX to local machine displays fine in MS powerpoint.

Not needed urgently, just thought it better to let you know as it may be an easy fix.

Cheers.

scanny commented 10 years ago

Hmm, interesting behavior. I suspect Gmail is reading the <Slides> element in the app.xml part of the pptx package. PowerPoint updates that on save to reflect the number of slides in the deck. I'd never heard of any applications using that data but might make sense to have python-pptx update that and perhaps some other document properties on save.