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

HOW to merge table cells with python-pptx lib

I have been faced with problem: How to merge some cells into big cell (vertically or horizontally merging) with python-pptx library? I've found no examples to do this and I need some help. Any help would be appreciated.
EugenS
  • 83
  • 11
2
votes
0 answers

Python-PPTX: How to set font properties of each individual entry in a legend?

I have an XY-Scatter chart made using Python-PPTX with a legend on the right side. I need to change the font color of individual legend entries based on certain criteria. Is there a way I can achieve this?
Utkarsh Sinha
  • 941
  • 2
  • 11
  • 30
2
votes
0 answers

Python-pptx Not able to remove/delete existing graph from ppt

pptx library to edit/add content to a ppt. I am adding a chart using below code to a slide but not able to delete the existing one so both are overlapping. Actually wanted to delete existing chart before adding new chart at same place. I am…
J Doe
  • 112
  • 7
2
votes
2 answers

xlwings: copy range and save as an image

I have an excel table that I am building using python logic via xlwings. Once calculated, I would like to copy that table (ie its range) and save it as an image (similar format to select range -> copy -> right click -> paste as image ). End goal is…
Merv Merzoug
  • 1,149
  • 2
  • 19
  • 33
2
votes
4 answers

Add Bullet list using python-pptx

I am using the python-pptx library for pptx manipulation. I want to add a bullet list in the pptx document. I am using the following snippet to add list item: p = text_frame.add_paragraph() run = p.add_run() p.level = 0 run.text = "First" But it…
Navdeep Singh
  • 21
  • 1
  • 5
2
votes
1 answer

Python PPTX Internal Hyperlink

I'm trying to use python-pptx to use a click action on a shape to go to another slide in the presentation. Similar to this question: Python PPTX Internal Hyperlinks workaround function Unlike the other tutorials and guides I have seen, I am not…
Chris B
  • 21
  • 3
2
votes
1 answer

reading pptx with python

i am using the python-pptx module to read contents of the file but sadly, i only get the text from the headers of every slide ..pfb the code i am using from pptx import Presentation prs = Presentation('Birds eye view - product.pptx') for slide in…
Vikram Murthy
  • 293
  • 6
  • 17
2
votes
1 answer

Adding a line to bar chart

I have a simple problem , i am trying to add a reference line on the head of a bar keeping my value axis line same. For example enter image description here I want to add that blue line on the top of my reference bar.
Aishwarya
  • 31
  • 3
2
votes
1 answer

Python PPTX Slide Layout Import

I apologize, I have been looking for a solution but can't find enough documentation to figure it out. I am trying to import a default slide layout required for school, it has a special background and a Title Block and a Subtitle Block. I assumed…
CBK
  • 660
  • 1
  • 7
  • 16
2
votes
2 answers

python-pptx with matplotlib fix image resolution

i am trying to generate a graph using matplotlib and save it to python-pptx . everything is working fine but the image resolution is low when imported to pptx.( i am just saving to memory using StringIO then using add_picture() in pptx to add…
anekix
  • 2,393
  • 2
  • 30
  • 57
2
votes
1 answer

python-pptx table - keep row height as small as possible

I want to create a table to be as short as it can possibly be, i.e. have the smallest row height possible, while fitting the prescribed text at the prescribed size. I am using this code: I initialize my table: init_table_width = prs.slide_width -…
R-Peys
  • 123
  • 1
  • 9
2
votes
3 answers

python-pptx Extract text from slide titles

I am building a document retrieval engine in python which returns documents ranked by their relevance with respect to a user submitted query. I have a collection of documents which also include PowerPoint files. For the PPTs, on the results page I…
Clock Slave
  • 7,627
  • 15
  • 68
  • 109
2
votes
2 answers

How to add slide in the middle of presentation using python-pptx?

I have a template.pptx , having 10 slides in total. I want to copy a slide/layout of slide 2 and add new slide after 2, between 2 and 3. what I can do currently is copy and add the slide at the end of presentation. prs =…
Dave D.
  • 737
  • 3
  • 10
  • 23
2
votes
3 answers

Python-pptx determine if text still within the slide

I am using the Python library python-pptx to generate some powerpoint and in some case - the text that is being generating is outside the slide ( because there are two many bullet or the text is too big ). For example :…
Florian
  • 31
  • 6
2
votes
1 answer

Chart Title for Chart using python-pptx

I am trying to add a title to my powerpoint chart created using python-pptx library. I am on OSX with Python 2.7 and Python pptx version 0.6.1. The code to create the charts is below : df =…
vagabond
  • 3,526
  • 5
  • 43
  • 76