Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't preview presentation in gmail #131

Open
andres-root opened this issue Nov 11, 2014 · 10 comments
Open

Can't preview presentation in gmail #131

andres-root opened this issue Nov 11, 2014 · 10 comments
Labels
Milestone

Comments

@andres-root
Copy link

Hi,
I'm trying to preview a presentation created with python-pptx in gmail but It says that it can't be opened. I'm not sure why is this happening. Is there a way to archive this with python-pptx?

Thanks!

@scanny
Copy link
Owner

scanny commented Nov 11, 2014

We need a substantially more complete description before we can act on this one.

@andres-root
Copy link
Author

This is a screenshot of what I mean. I also tried all of the options in the menu. In neither case does it work. I'm wondering if there is a way to format the pptx generated with python-pptx in order to allow gmail to preview the presentation.
issue

@andres-root
Copy link
Author

By the way thanks for your quick answer!

@scanny
Copy link
Owner

scanny commented Nov 11, 2014

Hmm, that's interesting. Can you open the presentation okay with PowerPoint? Also, what .pptx file did you start off with in python-pptx?

Also, what would you expect to appear? Would it just be the first slide or would you be able to page through the slides?

@andres-root
Copy link
Author

Well, when I do the same with a pptx generated with ms powerpoint or libre office it allows me to preview all the presentation. I can open the presentation without problems using powerpoint or libre office though.

@scanny
Copy link
Owner

scanny commented Nov 11, 2014

Ok, I have an idea what this might be. My hypothesis is that Gmail is looking for a slide count in the <Slides> element of the app.xml in the .pptx package. If a presentation is created from the default template, e.g. with document = Document() (no file path), that number is 0. This could be causing Gmail to think there are no slides in the package.

Give this a try and see if it works:

  1. With python-pptx, open an existing pptx file saved by PowerPoint or LibreOffice (i.e. not created with python-pptx).
  2. Save it without making any changes under a different filename
  3. See if that works with Gmail
document = Document('native.pptx')
document.save('touched-by-python-pptx.pptx')

If that works it would support the hypothesis. We can go from there.

@andres-root
Copy link
Author

Hi, I did the test, and I can preview the presentation, but, I made a test adding some shapes and then it only showed the first slide in the preview. For the test I used this tutorial on read the docs: https://python-pptx.readthedocs.org/en/latest/user/quickstart.html. Since the presentation that I create in my app is way more complex, I think that's the main reason it does not show any preview on gmail. However I'll keep testing if I see anything else.

@scanny
Copy link
Owner

scanny commented Nov 12, 2014

Did you only add shapes or did you actually add a slide as well?

@andres-root
Copy link
Author

I added a Slide as well.
On Nov 12, 2014 2:26 PM, "Steve Canny" [email protected] wrote:

Did you only add shapes or did you actually add a slide as well?


Reply to this email directly or view it on GitHub
#131 (comment).

@scanny
Copy link
Owner

scanny commented Nov 12, 2014

why don't you try with just adding shapes to an existing slide. If that works, it would point to adding a slide as the triggering event.

Then you could add a single blank slide and see if that triggers the break.

If you get it narrowed down to that I can give you a few lines of 'repair' code to fix up the slide count figure in app.xml and we'll see if that fixes it. I've got a suspicion it will.

@scanny scanny modified the milestone: soon-ish Nov 16, 2014
@scanny scanny added the package label Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants