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

Is it possible to set two value axis in python-pptx (one left, one right)

I frequently use python-pptx, with current version of 0.6.6.... Now I want to set up a chart with two value axis, one on the left, one on the right, just like this: In the doc of python-pptx, value_axis is accessed by chart.value_axis, but I have…
lkonweb
  • 27
  • 8
0
votes
1 answer

Python - pptx - Text Reads

Code to import data from table and text frame: pres = Presentation(ppt_file) for slide in pres.slides: for shape in slide.shapes: if(shape.has_text_frame): for paragraph in shape.text_frame.paragraphs: …
skrubber
  • 1,095
  • 1
  • 9
  • 18
0
votes
1 answer

Autofit column width with python pptx

I have inserted a table into a pptx file and I want to auto adjust the column width so that none of the texts in the column cells needs to break line. So simply I am searching for an autoadjust of the whole column. What I have so far is: from pptx…
horseshoe
  • 1,437
  • 14
  • 42
0
votes
1 answer

python pptx adding border to text

I am using Python 2.7 with python pptx and need to add border to some text i am writing. I need it to be a simple box in a color that i specify around the text I found here the text related object but I don't find any mention to what I need, and I…
thebeancounter
  • 4,261
  • 8
  • 61
  • 109
0
votes
1 answer

Different behavior in powerpoint and libreoffice by ppt generated using python-pptx

I am trying to create a file using python-pptx on a flask server. All of this is working and even the download is working by the problem comes when I try to use text_frame.auto_size in my code. LibreOffice Impress displays the text perfectly but MS…
yashdosi
  • 1,186
  • 1
  • 18
  • 40
0
votes
2 answers

Export chart as image with python xlwings

I have been working on creating Excel reports automatically using Python and xlwings. Within these reports there are multiple charts and graphs which I now want to use in a pptx presentation keeping the same formatting and design. For the generation…
Diego St
  • 59
  • 9
0
votes
1 answer

how to prevent text wrap in powerpoint table cell using python-pptx

In some rows of a table, a long text string in column 1 needs to continue over columns 2, 3, and 4, instead of wrapping. How would I either merge the cells or prevent the text from wrapping so that it continues over the subsequent columns? I have…
0
votes
1 answer

how to set text in powerpoint table cell without losing font format

I am writing python code to modify an existing powerpoint document using python-pptx. I can usually set text while preserving formatting, by setting text in the run: shape.text_frame.paragraphs[0].runs[0].text = 'mytext' However, in the tables I…
0
votes
3 answers

Send Presentation object as http response for download.

I am trying to develop a flask server which generates a presentation object based on json data and files from a HTTP Post request. I am able to generate the file locally with same code but when I try to send it as an http response is fails. Here…
yashdosi
  • 1,186
  • 1
  • 18
  • 40
0
votes
0 answers

python pptx inconsistant text frame location

I add text to a pptx slide, and wan't it to be aligned properly. i use the following code placing = (slide.width/2,0,slide.width/4,0) txBox = slide.shapes.add_textbox(placing[0], placing[1], placing[2], placing[3]) tf =…
thebeancounter
  • 4,261
  • 8
  • 61
  • 109
0
votes
1 answer

error installing python-pptx on windows 7 64 bit

I use python 2.7.12 with updated pip I need to install python-pptx on windows 7 64 bit machine, I try to use pip install python-pptx and get Command "c:\python27\python.exe -u -c "import setuptools,…
thebeancounter
  • 4,261
  • 8
  • 61
  • 109
0
votes
2 answers

python pptx get table width

I work with python 2.7 and using python pptx. I add a table to my slide, and need to get the table overall width. I found here the _column attribute width, and try to use it, for example with that code for col in table._column: yield…
thebeancounter
  • 4,261
  • 8
  • 61
  • 109
0
votes
1 answer

python pptx XyChart setting label font size

Within an python-pptx-generated XYchart, I would like to add labels to each point of the series. Code looks like this: for p, v in zip(chart.series[0].points, dataSeries): p.data_label.position = XL_LABEL_POSITION.ABOVE …
0
votes
2 answers

How do I add transparency to shape in python pptx?

def new_presentation(): prs=Presentation() img="C:/Users/Dennis/Desktop/Tom-Hiddleston-4-1024x768.jpg" mainsld=new_slide(prs, 6) mainshp=mainsld.shapes mainshp.add_picture(img, 0,0, Inches(10)) …
-1
votes
0 answers

How to convert a pdf file to pptx using python?

I can convert it using pdf2pptx only in anaconda prompt using the code: pdf2pptx slides.pdf. I can also convert using Aspose library, but it just converts 4 pages because it is not free. My question is: Is it possible to convert pdf file to pptx…
1 2 3
48
49