Skip to content

LearnIngest & extract

Office file formats

OOXML · DOCX, XLSX, PPTX

Word, Excel and PowerPoint files. Modern ones (.docx, .xlsx, .pptx) are zip archives of XML parts; legacy ones (.doc, .xls, .ppt) are binary containers.

In DocSlurpGlossary entry

On this page

Office file formats are the Word, Excel and PowerPoint families. There are two generations:

  • Office Open XML (.docx, .xlsx, .pptx), standardized as ECMA-376: a zip archive of XML files. Rename expansion-forecast.xlsx to .zip, open it, and you find xl/workbook.xml, one XML file per sheet and a shared-strings table.
  • Legacy binary formats (.doc, .xls, .ppt): a Compound File Binary container, a small file system inside the file, holding binary streams. Harder to parse and less common in new documents.

The important point for ingestion is that Office files carry structure a PDF has thrown away. A .docx marks headings as headings, lists as lists and tables as tables, in reading order. A .xlsx stores every value with a sheet name and a cell address such as B7, and records merged ranges explicitly. A .pptx stores each slide’s text boxes with their positions, plus speaker notes.

So read them natively. Converting a .docx to PDF and then extracting the PDF discards that structure and pays to reconstruct it with layout analysis and table extraction. Keep the native locations too: “sheet Expansion, range A1:F40” or “slide 9” makes a far better citation than a page number in a rendered copy.

The gotcha: a zip file is also an attack surface. A “zip bomb” is a small archive that expands to gigabytes, and paths inside an archive can try to escape their directory. Check entry counts, nesting depth and compression ratio before unpacking anything, and parse in a sandbox. See format detection.

In DocSlurp

In DocSlurp

Word and OpenDocument files go to pandoc, PowerPoint and Excel to python-pptx and openpyxl sidecars, each in the parser sandbox (core/worker/src/extractors/registry.ts); legacy .doc, .ppt and .xls files fail as unsupported. The same sidecars then attach slide shape boxes and sheet A1 ranges to blocks as locations (core/worker/src/lib/office-structure.ts). Zip-based uploads are checked for entry counts, depth and compression ratio first (core/worker/src/lib/quarantine.ts).

Sources

Jump to