PowerPoint

A PowerPoint deck is built from DrawingML: shapes, text runs and tables placed on slides that inherit from a layout and a master, rather than one rasterized picture per slide. BDF reads that DrawingML directly, instead of converting the file through an office suite's PDF export. As a result, the pptx converter's output keeps the master/layout sharing and the paragraph and bullet-list structure of the original text.

Try it

Drop a file on the viewer, or try a sample: PowerPoint deck, or a slide of formulas.

PowerPoint (.pptx)

converter/pptx reads the OPC zip package (.pptx, .pptm, .ppsx, .ppsm, .potx, .potm) and turns its DrawingML into BDF's own drawing instructions. The XML is parsed into a generic element tree rather than typed Go structs, since DrawingML has many optional elements and several layers of style inheritance. The same OPC and element-tree reader (converter/internal/ooxml) is shared with the Excel, Word and Visio converters, and the DrawingML drawing code (converter/internal/ooxml/drawingml) is shared with Excel's shapes and charts.

What's read:

How it's laid out: each slide becomes one page, in slide order; hidden slides are excluded unless asked for. Titles become headings, bullet levels become nested lists, and tables and pictures/shapes/charts become tables and figures with alt text in the accessible text layer. The language of each run of text is inferred from its script when that would otherwise be misread from a template's default language tag.

Options (-param, from bdf generate -h):

Option Values Default
-param hidden= true hidden slides excluded

-hidden is shorthand for -param hidden=true (Excel's -hidden does the same for hidden sheets). -pages selects which slides to convert, and the general font flags -font-dir, -fonts system, -no-subset, -no-woff2, -no-system-fonts and -ignore-fstype apply to PowerPoint the same way they do to Word and Excel.

See design.md §3.4 for the internals.

Filling a presentation as a template

A presentation whose shapes and tables hold tags such as {{name}} is a template of a form that data fills (bdf fill, pptx.Fill). The slides are fixed pages: text that changed is fitted again by the autofit rules of PowerPoint, and a table that grew past its slide goes on on copies of the slide. See Making forms.

Formulas

A formula inserted with Insert → Equation is saved as Office Math inside a paragraph (m:oMath in a14:m). The converter lays it out from that, not from the fallback picture the file also keeps, so it stays sharp at any zoom and is text in a linear notation for search and copy.

<a14:m>
  <m:oMath>
    <m:sSup><m:e><m:r><m:t>e</m:t></m:r></m:e><m:sup><m:r><m:t>iπ</m:t></m:r></m:sup></m:sSup>
    <m:r><m:t>+1=0</m:t></m:r>
  </m:oMath>
</a14:m>

A sample is converter/pptx/testdata/math.pptx. The layout is that of formulas in Word, HTML and Markdown.