Workflow 1: Creating a Business Presentation
Goal: Create a professional presentation with title slide, content slides, and conclusion.
Steps:
- Initialize Presentation
- Create new presentation object
- Set slide dimensions (standard 16:9 or 4:3)
- Configure metadata (title, author, subject, keywords)
- Add Title Slide
- Use title slide layout (typically prs.slide_layouts[0])
- Set title and subtitle text
- Apply formatting (font size, color, bold)
- Add Content Slides
- Use appropriate layouts (bullet, two-column, title-only, blank)
- Populate placeholders or add text boxes
- Format text with proper hierarchy
- Add Visual Elements
- Insert images with proper sizing and positioning
- Add charts with formatted data
- Create tables with cell styling
- Save Presentation
- Save to .pptx format
- Verify file creation
Quick Example:
```python
from pptx import Presentation
from pptx.util import Inches, Pt
prs = Presentation()
prs.slide_width = Inches(10)
prs.slide_height = Inches(7.5)
# Title slide
slide = prs.slides.add_slide(prs.slide_layouts[0])
slide.shapes.title.text = "Q4 Business Review"
slide.placeholders[1].text = "Prepared by: Jane Doe\nDate: October 25, 2025"
prs.save('presentation.pptx')
```
See examples/business-presentation.md for complete implementation.
Workflow 2: Adding Charts
Goal: Create data visualizations with bar, line, and pie charts.
Steps:
- Prepare chart data using
CategoryChartData - Define categories and series
- Add chart to slide with positioning
- Format chart (legend, gridlines, labels)
Quick Example:
```python
from pptx.chart.data import CategoryChartData
from pptx.enum.chart import XL_CHART_TYPE
chart_data = CategoryChartData()
chart_data.categories = ['Q1', 'Q2', 'Q3', 'Q4']
chart_data.add_series('2025', (9.5, 10.8, 11.2, 13.1))
chart = slide.shapes.add_chart(
XL_CHART_TYPE.COLUMN_CLUSTERED,
Inches(1), Inches(2), Inches(8), Inches(4.5),
chart_data
).chart
```
See examples/chart-examples.md for all chart types.
Workflow 3: Working with Images
Goal: Add, position, and format images in presentations.
Steps:
- Add image with
slide.shapes.add_picture() - Specify position (left, top) and size (width, height)
- Calculate centered positioning if needed
- Optimize images before adding (use Pillow for preprocessing)
Quick Example:
```python
# Add image with auto-scaled aspect ratio
pic = slide.shapes.add_picture('logo.png', Inches(1), Inches(1), height=Inches(2))
# Center image on slide
pic.left = int((prs.slide_width - pic.width) / 2)
pic.top = int((prs.slide_height - pic.height) / 2)
```
See examples/image-handling.md for advanced techniques.
Workflow 4: Creating Tables
Goal: Add structured data tables with formatting.
Steps:
- Define table dimensions (rows, cols)
- Add table with positioning
- Set column widths
- Populate headers with bold formatting and background color
- Fill data cells with proper alignment
Quick Example:
```python
table = slide.shapes.add_table(4, 3, Inches(1.5), Inches(2), Inches(7), Inches(3)).table
# Header formatting
cell = table.cell(0, 0)
cell.text = "Product"
cell.text_frame.paragraphs[0].font.bold = True
cell.fill.solid()
cell.fill.fore_color.rgb = RGBColor(0, 51, 102)
```
See examples/table-examples.md for advanced formatting.
Workflow 5: Editing Existing Presentations
Goal: Modify existing PowerPoint files.
Steps:
- Open presentation with
Presentation('file.pptx') - Iterate through slides to find content
- Modify text, shapes, or add new elements
- Save with same or different filename
Quick Example:
```python
prs = Presentation('existing.pptx')
# Find and update text
for slide in prs.slides:
for shape in slide.shapes:
if hasattr(shape, "text") and "Old Name" in shape.text:
shape.text = shape.text.replace("Old Name", "New Name")
prs.save('updated.pptx')
```
See examples/editing-presentations.md for slide copying and advanced editing.
Workflow 6: Using Templates
Goal: Apply consistent branding with master slides and templates.
Steps:
- Start with template file:
Presentation('template.pptx') - Examine available layouts
- Add slides using template layouts
- Apply brand colors consistently
Quick Example:
```python
prs = Presentation('corporate_template.pptx')
# Use template layouts
title_slide = prs.slides.add_slide(prs.slide_layouts[0])
content_slide = prs.slides.add_slide(prs.slide_layouts[1])
# Layouts inherit master formatting
prs.save('branded_presentation.pptx')
```
See references/templates-and-themes.md for master slide customization.
Workflow 7: Bulk Slide Generation
Goal: Generate multiple slides automatically from data.
Steps:
- Load data from CSV, JSON, or database
- Create presentation object
- Iterate through data records
- Generate one slide per record
- Populate slide with record data
Quick Example:
```python
import pandas as pd
df = pd.read_csv('employee_data.csv')
prs = Presentation()
for _, row in df.iterrows():
slide = prs.slides.add_slide(prs.slide_layouts[1])
slide.shapes.title.text = row['Name']
# Add employee details to slide body
prs.save('employee_directory.pptx')
```
See examples/bulk-generation.md for complete implementations.