Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -105,9 +105,9 @@ if uploaded_file is not None:
|
|
| 105 |
# Create a slide
|
| 106 |
slide = prs.slides.add_slide(prs.slide_layouts[5])
|
| 107 |
|
| 108 |
-
# Add the image to the slide at the bottom
|
| 109 |
left = (prs.slide_width - Inches(3)) / 2
|
| 110 |
-
top = prs.slide_height - Inches(3)
|
| 111 |
pic = slide.shapes.add_picture(temp_img_path, left, top, Inches(3), Inches(3))
|
| 112 |
|
| 113 |
# Add the paragraph to the slide at the top
|
|
@@ -118,14 +118,9 @@ if uploaded_file is not None:
|
|
| 118 |
txBox = slide.shapes.add_textbox(left, top, width, height)
|
| 119 |
tf = txBox.text_frame
|
| 120 |
p = tf.add_paragraph()
|
| 121 |
-
p.text = f"Paragraph {i}:"
|
| 122 |
-
p.space_after = Pt(8) # Adjust the spacing as needed
|
| 123 |
-
p = tf.add_paragraph()
|
| 124 |
p.text = summary_text
|
| 125 |
p.space_after = Pt(0) # Adjust the spacing as needed
|
| 126 |
|
| 127 |
-
i += 1
|
| 128 |
-
|
| 129 |
# Save the PowerPoint presentation
|
| 130 |
presentation_path = tempfile.NamedTemporaryFile(delete=False, suffix=".pptx").name
|
| 131 |
prs.save(presentation_path)
|
|
|
|
| 105 |
# Create a slide
|
| 106 |
slide = prs.slides.add_slide(prs.slide_layouts[5])
|
| 107 |
|
| 108 |
+
# Add the image to the slide at the bottom with a 0.5-inch space
|
| 109 |
left = (prs.slide_width - Inches(3)) / 2
|
| 110 |
+
top = prs.slide_height - Inches(3) - Inches(0.5) # Adjusted for the 0.5-inch space
|
| 111 |
pic = slide.shapes.add_picture(temp_img_path, left, top, Inches(3), Inches(3))
|
| 112 |
|
| 113 |
# Add the paragraph to the slide at the top
|
|
|
|
| 118 |
txBox = slide.shapes.add_textbox(left, top, width, height)
|
| 119 |
tf = txBox.text_frame
|
| 120 |
p = tf.add_paragraph()
|
|
|
|
|
|
|
|
|
|
| 121 |
p.text = summary_text
|
| 122 |
p.space_after = Pt(0) # Adjust the spacing as needed
|
| 123 |
|
|
|
|
|
|
|
| 124 |
# Save the PowerPoint presentation
|
| 125 |
presentation_path = tempfile.NamedTemporaryFile(delete=False, suffix=".pptx").name
|
| 126 |
prs.save(presentation_path)
|