pptx-to-html5

December 14, 2025 ยท View on GitHub

CI PyPI version PyPI - Python Version

A Python tool for converting PowerPoint presentations (.pptx) to interactive HTML5 websites with accurate positioning.

Features

  • ๐ŸŽจ Convert PowerPoint presentations to standalone HTML5 websites
  • ๐Ÿ“ Accurate element positioning - Preserves the layout and positioning of text boxes, images, and other elements from your slides
  • ๐Ÿ“ฑ Responsive design that works on desktop and mobile devices
  • โŒจ๏ธ Keyboard navigation (arrow keys, space, Home, End)
  • ๐Ÿ‘† Touch/swipe support for mobile devices
  • ๐Ÿ“ Optional speaker notes inclusion
  • ๐ŸŽฏ Clean, modern UI with smooth transitions
  • ๐Ÿ”„ Progress bar and slide counter
  • ๐Ÿ’ป Command-line interface for easy automation
  • ๐Ÿ“‹ Bullet point support - Multi-level bullets with proper indentation

How It Works

The converter extracts individual shapes (text boxes, images, etc.) from your PowerPoint slides along with their exact positions, sizes, and formatting. These are then rendered as positioned HTML elements, maintaining the original slide layout.

  • Text elements: Preserved with font size, style (bold/italic), and alignment
  • Bullet points: Multi-level bullets (โ€ข, โ—ฆ, โ–ช) with proper indentation based on paragraph level
  • Images: Embedded as base64-encoded data URIs with automatic format detection
  • Positioning: Converted to percentage-based CSS positioning for responsive scaling

Requirements

  • Python 3.12 or higher
  • Dependencies: python-pptx, Pillow, Jinja2

Installation

pip install pptx-to-html5

From source

git clone https://github.com/shafe123/pptx-to-html5.git
cd pptx-to-html5
pip install -e .

Development installation

pip install -e ".[dev]"

Usage

Command Line

Convert a PowerPoint presentation to HTML5:

pptx-to-html presentation.pptx

Specify an output directory:

pptx-to-html presentation.pptx -o output_folder

Include speaker notes in the output:

pptx-to-html presentation.pptx --include-notes

Python API

from pptx_to_html5.converter import PowerPointToHTML5Converter

# Create converter
converter = PowerPointToHTML5Converter("presentation.pptx")

# Convert to HTML5
output_path = converter.convert("output_folder", include_notes=False)

print(f"Presentation converted to: {output_path}")

Output Structure

The converter creates a self-contained website with:

  • index.html - Main presentation file
  • styles.css - Styling and layout
  • script.js - Navigation and interactivity

Simply open index.html in any modern web browser to view the presentation.

  • Arrow Keys (โ† โ†’): Navigate between slides
  • Space Bar: Next slide
  • Home: Go to first slide
  • End: Go to last slide
  • Mouse/Touch: Use on-screen buttons or swipe gestures

Development

Running Tests

pytest

Code Quality

The project follows PEP8 style guidelines and uses type hints throughout.

Run linting:

ruff check src/

Run type checking:

mypy src/

License

This is free and unencumbered software released into the public domain - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.