Rendering Thumbnails
The thumbnail renderer shells out to LibreOffice (soffice) to produce PNG previews of slides — handy for agent feedback loops, CI visual diffs, or gallery pages like this one.
Requirements
soffice(LibreOffice) onPATHpdftoppm(Poppler) orpypdfium2for the PDF→PNG split path
Without them you get ThumbnailRendererUnavailable — catch it to degrade gracefully.
Usage
from power_pptx import Presentation
prs = Presentation("deck.pptx")
prs.render_thumbnails(out_dir="thumbs") # every slide → PNGfrom power_pptx.render import render_slides
# Selected slides with a name template
render_slides(
prs,
slides=[0, 1, 2],
out_dir="thumbs",
name_template="slide-{:02d}.png",
)The agent feedback loop
- Agent generates the deck and calls
slide.tidy(). render_thumbnails()produces PNGs of the result.- The agent (or a human) inspects the thumbnails and iterates.
Combined with audit(prs).markdown(), this closes the loop between generation and verification without ever opening PowerPoint.