Parsing a Word file directly vs converting it to PDF first. Many document pipelines turn DOCX, XLSX and PPTX files into PDF, then use a model to work out the layout again. That step discards track changes, comments and merged cells, and adds time and per-page cost. AILANG Parse reads the Office XML directly, so the structure reaches your RAG or AI application as the author wrote it.
The Round-Trip Problem
An Office file is a ZIP archive of XML. Track changes, comments, merged cells, headers, footers and speaker notes are all in that XML, each one labelled. Converting to PDF reduces this to characters placed on a page. Then an ML model has to guess the structure from where things sit on the page.
Two lossy steps against none.
What Each Parser Keeps
What four parsers return when they read a DOCX, PPTX or XLSX file.
| What is kept | AILANG Parse | Unstructured | Docling | MarkItDown |
|---|---|---|---|---|
| Tracked changes returned | 3 of 3 files | 0 of 3 files | 0 of 3 files | 0 of 3 files |
| Comments returned | 2 of 2 files | 0 of 2 files | 2 of 2 files | 0 of 2 files |
| Headers and footers returned | 2 of 2 files | 1 of 2 files | 2 of 2 files | 0 of 2 files |
| Text boxes returned | 1 of 1 files | 0 of 1 files | 0 of 1 files | 0 of 1 files |
| Speaker notes returned | 2 of 3 files | 2 of 2 files | 3 of 3 files | 2 of 2 files |
| Table cells: position, merges, formulas | 100.0% | 78.8% | 93.0% | 81.0% |
| List type and depth | 80.0% | 0.0% | 80.0% | 29.2% |
| Overall score, on the files it could read | 95.0% | 67.6% | 73.4% | 68.4% |
| Overall score, counting unreadable files as zero | 95.0% | 61.4% | 70.9% | 57.4% |
Measured on OfficeDocBench: how many of the test files containing each feature the parser returned it for, and the benchmark scores. Every figure is read from the published results.
A low figure is data that was in the source file and did not reach the output. Legal, compliance and audit work cannot afford that.
Using Alongside Other Tools
PDFs need ML, because there is no XML to read. But Office documents are not PDFs, and sending them through a PDF pipeline loses information for no reason.
In practice: use AILANG Parse for Office formats, where it reads the XML directly, and your preferred tool for PDFs, where ML is needed.
Before: everything through one ML pipeline
# Everything through a PDF-first pipeline
from unstructured.partition.auto import partition
# Converts DOCX to PDF internally,
# then runs ML on the PDF.
# Track changes, comments, merged cells: gone.
elements = partition(filename="report.docx")
After: right tool for each format
from ailang_parse import DocParse
from unstructured.partition.pdf import partition_pdf
if filename.endswith(('.docx', '.pptx', '.xlsx')):
# Read the Office file directly: structure kept, no per-page billing
blocks = DocParse(api_key="dp_YOUR_KEY").parse_file(filename).blocks
else:
# ML pipeline where it's actually needed
elements = partition_pdf(filename)
Keep your PDF pipeline as it is. Add AILANG Parse for Office formats, where reading the file directly gives better results.
See for Yourself
Upload a DOCX with track changes, a PPTX with speaker notes, or an XLSX with merged cells. Compare the output with whatever you are currently using.
Frequently Asked Questions
What exactly is lost when converting DOCX to PDF before parsing?
Five kinds of data are lost: (1) track changes and revision history, (2) which table cells are merged, (3) comments and their authors, (4) heading levels, which PDF does not record, and (5) document metadata such as custom properties. AILANG Parse keeps all five by reading the Office XML directly.
Why do wrapper-based parsers have quality problems with DOCX parsing?
Many of them return a document’s text and leave out its structure: tracked changes, comments, notes and list nesting. AILANG Parse scores 95.0% on OfficeDocBench and reads every file. The table above shows what Unstructured, Docling and MarkItDown returned on the same files.
Is PDF parsing always worse than direct DOCX parsing?
When the source is a DOCX, reading the XML directly is better: it is more accurate, has no per-page billing, and keeps metadata that PDF conversion drops. If your source is a PDF or a scan, you need an ML-based PDF parser. AILANG Parse does both: it reads Office XML directly and uses an AI model of your choice (Gemini, Claude, Ollama) for PDFs.