Skip to main content

Convert PDF Slides to PowerPoint Presentations with Vector Graphics

Project description

English | 简体中文 | 繁體中文 | 日本語

pdf2ppt

PyPI version Python License: MIT GitHub stars

Convert PDF Slides to PowerPoint Presentations with Vector Graphics (highest resolution).

✨ Features

  • 🎯 Vector Graphics - Maintains highest resolution in generated PPT
  • 📝 Metadata Conversion - Preserves title, author and other metadata
  • 📐 Auto Detection - Automatically detects slide size and aspect ratio
  • 🚀 Easy to Use - Simple command line interface with beautiful output
  • 📄 Page Selection - Convert specific pages with --pages option
  • Parallel Processing - Speed up conversion with --parallel option
  • 🔍 Dependency Check - Automatically checks for required tools

🎯 Motivation

  • LaTeX users can easily convert beamer slides from PDF to PPT
  • Typst users can easily convert touying slides from PDF to PPT

🚀 Quick Start

# Install via pipx (recommended)
pipx install pdfslides2ppt

# Or install via pip
pip install pdfslides2ppt

# Convert PDF to PPT
pdf2ppt input.pdf output.pptx

📦 Installation

Prerequisites

  • Python >= 3.9
  • pdf2svg - for PDF to SVG conversion
  • Inkscape - for SVG to EMF conversion

Install Dependencies

macOS:

brew install pdf2svg inkscape

Ubuntu/Debian:

sudo apt-get install pdf2svg inkscape

Windows:

Install pdf2ppt

# Recommended: Install with pipx (isolated environment)
pipx install pdfslides2ppt

# Or install with pip
pip install pdfslides2ppt

📖 Usage

Basic Usage

# Specify output file
pdf2ppt input.pdf output.pptx

# Auto-generate output filename (input.pptx)
pdf2ppt input.pdf

# Verbose mode
pdf2ppt input.pdf --verbose

Advanced Usage

# Convert specific pages
pdf2ppt input.pdf -p 1-5,7,9-11

# Parallel processing (4 workers)
pdf2ppt input.pdf -j 4

# Force overwrite existing file
pdf2ppt input.pdf output.pptx --force

# Keep temporary files for debugging
pdf2ppt input.pdf --no-clean

Command Line Options

usage: pdf2ppt [-h] [-v] [--verbose] [--no-clean] [--no-check] [--force]
               [--pages PAGES] [--parallel PARALLEL]
               [--pdf2svg-path PATH] [--inkscape-path PATH]
               input [output]

positional arguments:
  input                 Input PDF file
  output                Output PPTX file (default: input.pptx)

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  --verbose             Verbose output
  --no-clean            Keep temporary files
  --no-check            Skip SVG filter check
  --force, -f           Overwrite output file if exists
  --pages, -p PAGES     Page range (e.g., "1-5,7,9-11")
  --parallel, -j N      Parallel workers (default: 1)
  --pdf2svg-path PATH   Path to pdf2svg executable
  --inkscape-path PATH  Path to inkscape executable

🔧 Technical Implementation

  1. Convert PDF to SVG using pdf2svg
  2. Convert SVG to EMF using inkscape (due to python-pptx limitations)
  3. Insert EMF into PPT using python-pptx

🛠️ Tech Stack

Component Technology
Language Python 3.9+
PDF Processing pypdf
PPT Generation python-pptx
PDF to SVG pdf2svg
SVG to EMF Inkscape
CLI Output rich

⚠️ Known Issues

Transparent Background

Elements with transparency are not fully supported due to dependency limitations. You will receive a warning when such issues are detected. You can manually copy the generated SVG to fix the problem.

See #1 for more details.

🤝 Contributing

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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright © 2023-2024 Teddy van Jerry (Wuqiong Zhao)

⭐ Star History

Star History Chart

📱 Follow Us

WeChat

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdfslides2ppt-1.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdfslides2ppt-1.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file pdfslides2ppt-1.1.0.tar.gz.

File metadata

  • Download URL: pdfslides2ppt-1.1.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for pdfslides2ppt-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4b089c7f55bfe3aa99a26b727f77d9aaec6bc2f47c521cd8cadf1aceb07f5fb4
MD5 20c652c57ae365a7daf5f01f1907fb87
BLAKE2b-256 320ba51249e9171bbb44d20a00aa54c100748e410bab4875ea9e6d5e4818352f

See more details on using hashes here.

File details

Details for the file pdfslides2ppt-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pdfslides2ppt-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for pdfslides2ppt-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0abb602a873a55af00624cb80df6954fdaf4345c33d6d8ef1d54355c4089456
MD5 e5b323470e680e65e907144a3c631033
BLAKE2b-256 53d6707ea3d5dfccbac72ab1acaa0ecdf764378dfec45f01341a17b2dd1b6336

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page