docling-project / docling-project/docling
Support for OLE Embedded Objects Extraction and Conversion
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 98
Description
### Requested feature
Add support for detecting, extracting, and converting OLE embedded objects (e.g., Excel, PowerPoint) in Word documents, with proper references in the `DoclingDocument` JSON.
Currently, embedded files are ignored, which can cause the loss of critical data.
### Current Behavior
- Docling successfully converts the main Word document content
- Embedded OLE objects are ignored and not extracted
- No reference to embedded files is present in the output JSON
Docling already uses `python-docx` (v1.1.2+), which is capable of **identifying OLE objects** through *package* relationships. The MSWord backend even accesses `docx_obj.part.rels` for images.
**However, it currently processes only `embed` relationships** — completely ignoring `package` relationships that point to OLE objects.
### Proposed Solution
1. Detect OLE objects via relationship types:
- `http://schemas.openxmlformats.org/officeDocument/2006/relationships/package`
- `http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject`
2. Extract embedded files to temp storage
3. Process extracted files with appropriate Docling backends
4. Link converted content back to the main document in JSON (see example JSON schema at the bottom of this issue).
### Alternatives
I've considered a custom workflow that would pre-extract embedded files using `python-docx`, process them separately through Docling, and then manually merge the metadata back into the JSON.
While this could work, it would be cumbersome, error-prone, and unlikely to achieve the same level of integration, maintainability, or performance as native support within Docling.
### Benefits
- **Complete Document Processing**: No data loss during conversion
- **Improved RAG/AI Applications**: Access to all document content, not just text
- **Better Workflow Efficiency**: Single conversion step instead of manual extraction
---
Thank you for considering this enhancement.
Your work on Docling is greatly appreciated, and this feature would make it even more powerful for real-world document processing scenarios.
---
### Example JSON Schema Extension
```json
{
"embedded_files": [
{
"id": "embedded_1",
"label": "ole_object",
"prov": [
{
"page_no": 1,
"bbox": {"l": 100.0, "t": 200.0, "r": 300.0, "b": 250.0},
"charspan": [0, 0]
}
],
"ole_metadata": {
"relationship_id": "rId12",
"content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"original_filename": "requirements.xlsx",
"size_bytes": 47715
},
"content_reference": {
"type": "file_reference",
"uri": "extracted/embedded_1.xlsx",
"hash": "sha256_of_extracted_file"
},
"processing_status": {
"extracted": true,
"converted": true,
"integrated": true
}
}
]
}
Contributor guide
Assessment
This issue has not been assessed yet.