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
4
votes
1 answer

How to duplicate PowerPoint files in python?

Problem: I'm trying to duplicate a slide from a presentation to another presentation, but it returns error: Traceback (most recent call last): File "C:\Users\vuse1\documents\visual studio…
hod kakun
  • 41
  • 2
4
votes
2 answers

Python pptx: how to find and delete the empty or unpopulated placeholders

I have created a presentation using python-pptx. However, some slides have the empty placeholders with default text click to add title/text that looks like the one below. So basically, there are non-empty placeholder with text Some texts here and…
asdfkjasdfjk
  • 3,784
  • 18
  • 64
  • 104
4
votes
1 answer

Insert a line into a PowerPoint using python pptx module

The following lines of codes shows how to draw a line in PowerPoint slides using python. However, the four parameters in inches listed below only takes positive values so could not draw backwards. Is there any other way to draw lines in PowerPoint…
Raj Stha
  • 1,043
  • 11
  • 18
4
votes
2 answers

Python Pptx - Modify Existing Table

I'm very new to the python-pptx module, so please excuse my ignorance. I'm trying to modify an existing table in a PowerPoint file, but I don't see anywhere in the documentation where I can do this. I see where you can use the add_table() method to…
Walt Reed
  • 1,336
  • 2
  • 17
  • 26
4
votes
2 answers

Python-pptx formatting datalabels after adding text

As I needed to add custom text to a chart data labels in python-pptx I used for point in plot.series[1].points: frame = point.data_label.text_frame frame.text = "Test " for run in frame.paragraphs[0].runs: run.font.size = Pt(10) …
CheshCat
  • 43
  • 6
4
votes
1 answer

python-pptx save each slide of an existing ppt as picture

I am using power point as the user interface of my web page to make a simple pictures. What I do today is create slides in ppt and then save each slide as a picture, then my web would download the picture and show it. I would like to automate this…
4
votes
1 answer

Editing underlying PowerPoint XML with Python (python-pptx)

I have PowerPoint files with many dozens of links to different sheets in an Excel document. I need to change the Excel documents to which these links point in a programmatic way. I'm pretty sure I could do this with VBA, but since I'm generating…
dan_g
  • 2,712
  • 5
  • 25
  • 44
4
votes
1 answer

How to insert a custom layout to the powerpoint using python pptx

I am trying to create 1000s of powerpoint presentations. I am using python pptx to achieve that. So far so good, but I dont like the slide size which is by default 4:3. Can I create a template slide(with custom formatting of slide size and default…
Gowtham
  • 131
  • 2
  • 12
4
votes
1 answer

python-pptx - set proofing language

I want to use the python-pptx module to change the proofing language of every text-containing shape in a given powerpoint presentation. Unfortunately I do not manage. :( I'm using Python 3.6.3 and python-pptx 0.6.7. My code looks like this: from…
ChristianH
  • 53
  • 1
  • 7
4
votes
1 answer

python-pptx ".ppt" handling work around

I am currently attempting to pull text from .ppt and .pptx files. I am successfully using python-pptx in order to handle .pptx files, BUT according to its documentation, ".ppt files from PowerPoint 2003 and earlier won’t work." When creating a…
4
votes
1 answer

Adding text / slide title to placeholder on slide with python-pptx

I am trying to add a title to my slide . I was looking up the documentation here and it says, "Setting the slide title Almost all slide layouts have a title placeholder, which any slide based on the layout inherits when the layout is applied.…
vagabond
  • 3,526
  • 5
  • 43
  • 76
4
votes
1 answer

Combining line plots and bar plots in a single chart in python-pptx

I need to produce a chart with consisting of both of line plot and bar plot using python-pptx. Based on documentation, it was stated that "Most charts only have a single plot and python-pptx doesn’t yet support creating multi-plot charts, but…
idazuwaika
  • 2,749
  • 7
  • 38
  • 46
4
votes
1 answer

python-pptx change picture in layout

I try to enable automatically import pictures in order to prevent manually ad 100's of pictures each time. I seem to be unable to access the placeholders of the pictures and replace them with a new picture. some guide in the correct direction would…
4
votes
3 answers

Python pptx custom color for each category

I'm looking at example here: https://python-pptx.readthedocs.org/en/latest/user/charts.html?highlight=color#pie-chart chart_data = ChartData() chart_data.categories = ['West', 'East', 'North', 'South', 'Other'] chart_data.add_series('Series 1',…
sevatster
  • 133
  • 1
  • 3
  • 11
3
votes
1 answer

python ppt find and replace within a chart

I already referred these posts here here, here and here. Please don't mark it as a duplicate. I have a chart embedded inside the ppt like below I wish to replace the axis headers from FY2021 HC to FY1918 HC. Similarly, FY2122 HC should be replaced…
The Great
  • 7,215
  • 7
  • 40
  • 128