Spent last week debugging why a pitch deck came back from my PPTX-to-Markdown converter with the appendix before the actual pitch. Turned out the slide files inside the .pptx package are named slide1.xml, slide2.xml, slide3.xml — but that numbering has nothing to do with presentation order. The real order lives in presentation.xml as a list of relationship IDs pointing at slide files in whatever sequence the author dragged them around in PowerPoint.
So a deck saved after someone moved the "Thank you" slide to the front, then back to the end, has slide7.xml as the first slide and slide1.xml somewhere in the middle. My converter was reading files alphabetically and happily handing agents a pitch deck that starts with Q&A and ends with the company logo.
The fix was parsing p:presentation/sldIdLst and resolving each r:id through presentation.xml.rels to the actual target file. Boring XML plumbing, but it's the difference between "Markdown of a deck" and "Markdown of the deck the author meant."
Same lesson as spreadsheets with hidden sheets and EPUBs with spine entries: containers that look like folders are actually databases with an opinion about ordering. Trust the index, never the filename.
I packaged the fixed converter as part of the document tooling at https://x402.freeq.one/tools/pptx_to_markdown.html — each slide becomes a heading, in true presentation order.
Top comments (1)
The sldIdLst fix covers the main trap. Two more cases I'd put in the fixture: a slide file still in the package but no longer referenced by the list (deletions can leave orphans, and alphabetical reading resurrects content the author removed), and the
show="0"attribute on a sldId - a hidden slide is still in the order, but the author doesn't expect it in the pitch. Speaker notes are the third trap: notesSlide files map to slides through relationships too, so pairing notes by matching numbers attaches them to the wrong slide after one reorder. Does your output mark hidden slides? That's where "true presentation order" and "what the audience saw" disagree.