pdfspine
pptspine

pptspine

A pure-Rust PowerPoint (.pptx) parser with Python bindings — structural parsing plus faithful .pptx → PDF export. Apache-2.0, on PyPI.

A pure-Rust PowerPoint (.pptx) parser with Python bindings — now with faithful .pptx → PDF export.

A .pptx file is OOXML: a zip archive of XML parts. pptspine walks that XML directly to produce a structured, information-preserving model of a deck — slides, text frames (paragraphs + styled runs), tables (cells, merges, fills), pictures, and autoshapes. As of v0.2.0 it also renders a deck to PDF. It ships as an abi3-py311 wheel under Apache-2.0; the only runtime dependency is ocrspine-models.

pip install pptspine

Capabilities

  • Structural parsing. Open a deck from a path or bytes, walk its slides and shapes, and read text frames, tables, pictures, and speaker notes. Convert the whole deck to plain text or Markdown with to_text() / to_markdown().
  • .pptx → PDF export. Presentation.to_pdf() renders one PDF page per slide at the exact slide size, resolving the slideLayout / slideMaster / theme inheritance chain so placeholder text looks like it does in PowerPoint.
  • Local OCR. Embedded images can be OCR'd offline and deterministically via the sibling ocrspine engine (PP-OCRv5 through tract-onnx) — no cloud, no network.

PDF export in two lines

import pptspine

pres = pptspine.open("deck.pptx")
pres.save_pdf("deck.pdf")            # one PDF page per slide

Shared typesetting engine

PDF export is built on pdf-typeset, a first-party Rust typesetting engine that lives in the pdfspine workspace and backs both pptspine's and docspine's → PDF export. It is a self-authored, deterministic layout engine — not an HTML/CSS or Story engine. Output is text-extractable (a ToUnicode map is always written) and deterministic per font environment.

The Spine family

pptspine is one of three document-processing packages that share this typesetting core:

PackageHandlesOn this site
pdfspinePDF read / edit / render, plus Markdown → PDFIntroduction
docspine.docx → model / PDFdocspine
pptspine.pptx → model / PDFyou are here

All three are Apache-2.0, pure-Rust, abi3-py311 wheels installable with a single pip install.

On this page