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.

Release status

The latest release on PyPI is pptspine 0.5.1. Merged on main but not yet released:

  • Dependencies aligned to pdfspine v0.11.2 (pdf-typeset / pdf-fonts) and ocrspine 041958a.
  • PDF export: run-level spc / baseline / cap, connector line ends (headEnd / tailEnd), and custGeom approximated with a warning — see PDF export.
  • Hardening: zip reads are bounded by ZipLimits (violations raise PptZipError), group / mc:AlternateContent nesting deeper than 64 is skipped, and ppt-ocr panics surface as PptOcrError.
  • CI: the wheels job's OCR smoke test, failing since 2026-07, is fixed.

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