Questions tagged [python-pptx]

python-pptx is a Python library for creating and updating PowerPoint (.pptx) files.

python-pptx is a Python library for creating and updating PowerPoint (.pptx) files.

Latest documentation

Available from pypi.

734 questions
0
votes
2 answers

editing the position of a shape in PowerPoint

from pptx import Presentation prs = Presentation(my_file) print(prs.slides[1].shape[0]) #out: # I need to loop through my shapes and assign a custom height, width and vertical position : height =…
Umar.H
  • 22,559
  • 7
  • 39
  • 74
0
votes
1 answer

No module named `pptx`

I try to import pptx (from pptx import Presentation) and get message "No module named pptx". I've installed pptx (pip install python-pptx). Running pip show python-pptx, I get: Name: python-pptx Version: 0.6.18 Summary: Generate and manipulate…
0
votes
1 answer

How to put multiple layout themes on 'slide_layouts' on python-pptx

I've been trying to use some custom layouts on a python-pptx prs, but when I call the prs.slide_layouts method, it return only some of the layouts, only from one of the layout themes. The presentation I'm using has almost 100 layouts, but when I…
olenscki
  • 487
  • 7
  • 22
0
votes
3 answers

convert pptx into PNGs

Is there a way of converting a pptx file into png files for each slide using Python? I was thinking of converting pptx into pdf and then converting each pages into png but not sure if it is the optimal way.
user12392864
  • 288
  • 1
  • 3
  • 11
0
votes
1 answer

Adding dataframe and text in ppt using python-pptx in slide layout 3

I have created ppt using the below code: prs = Presentation() class MySlide: def __init__(self, data): self.layout = prs.slide_layouts[data[2]] self.slide=prs.slides.add_slide(self.layout) …
RSM
  • 645
  • 10
  • 25
0
votes
1 answer

How to alter a presentation to display all texts in upper case?

I haven't found in the documentation how to display a paragraph in upper case (all capitals). I don't want to change the underlying text, only how it's displayed.
Paulo Lieuthier
  • 426
  • 7
  • 14
0
votes
1 answer

Error when Import pptx "ImportError: DLL load failed: The specified procedure could not be found."

I have a very similar issue to this thread however the solution is not fixing my issue. I keep getting this error. Traceback (most recent call last): File "", line 1, in File "C:\Program…
pav
  • 59
  • 1
  • 12
0
votes
0 answers

How to remove content from placeholder?

Is there a method to remove an already inserted picture in a placeholder from a populated state to an unpopulated state through python rather than delete the image manually in powerpoint?
0
votes
1 answer

Python-pptx: How to update existing data on second and third slide

On an existing PowerPoint, I'm updating charts (e.g. line graphs, bar charts) that are on each slide (i.e. slides 1, 2, and 3). I can update the first slide using the code below, but can't access the data for the second slide. How can I access the…
shredGnar
  • 149
  • 2
  • 11
0
votes
1 answer

How to change text color in python-pptx?

Currently this is my code: from pptx import Presentation from pptx.util import Pt f = open(r'template.pptx', 'rb') prs = Presentation(f) f.close() slide = prs.slides.add_slide(prs.slide_masters[0].slide_layouts[1]) title =…
Arthur Coimbra
  • 437
  • 1
  • 6
  • 16
0
votes
0 answers

Why doesn't my font.name property affect the fonts on ppt made using Python-pptx? I always get arial font

So I'm trying to write some program to convert html to pptx using Python. I'm using some code to parse through the file and then format text at run level. I am using 2 textframes on a blank slide to work, the first textframe is used for title and…
0
votes
1 answer

Accessing Spell Check through PPTX

Do we have an option in python-pptx to read the spell check mode used in the presentation? I am working on a project in which I have to check the spell check mode is set to "UK English". Can you help?
0
votes
1 answer

Is there a python-pptx function that is able to read the background color of a table cell?

I'm trying to read the background color of a cell in a table in a pptx file with python-pptx module, but I am only able to set a _Cell's fill property, not able to read a value from it. I tried reading fill.back_color, but they were all…
M. Zhang
  • 750
  • 8
  • 18
0
votes
0 answers

Read slide mode and spell check option

Do we have an option in python to check the slide mode (fit mode) and what type of spellcheck used in the presentation??? I am developing a code in python which requires me to check all these parameters. Please let me know if there is a way...
0
votes
2 answers

Saving area within a shape (rectangle) as image from multiple powerpoint slides

I'm attempting to grab an image of diagrams constructed within a rectangle on a power point slide deck. I found python-pptx and am able to identify the shapes on each slide. Is there any way to expand this to take a snapshot of the area within the…