Context
When processing DOCX files, to_document() correctly extracts embedded images into doc.assets (with raw bytes, media type, and origin part). However, these images don't appear in the markdown output from to_markdown_bytes() — there are no  references, and the inline block model doesn't surface image inlines.
Current behavior
doc = anydoc.to_document(docx_bytes)
print(len(doc.assets)) # 1 (608KB PNG found)
md = anydoc.to_markdown_bytes(docx_bytes)
print(" or ) at the positions where images appear in the document. The actual bytes are already in doc.assets — consumers could then decide whether to inline them as data URIs, upload them, or send them to a vision model for descriptions.
This would also apply to XLSX and PPTX files that contain embedded images/charts.
Workaround
Using to_document() to get the asset bytes and processing them separately works, though without positional information it's hard to associate an image with the surrounding content.
Context
When processing DOCX files,
to_document()correctly extracts embedded images intodoc.assets(with raw bytes, media type, and origin part). However, these images don't appear in the markdown output fromto_markdown_bytes()— there are noreferences, and the inline block model doesn't surface image inlines.Current behavior
The asset data is extracted and available, but the markdown doesn't reference it.
Request
It would be useful if
to_markdown_bytes()emitted image references (e.g.,or) at the positions where images appear in the document. The actual bytes are already indoc.assets— consumers could then decide whether to inline them as data URIs, upload them, or send them to a vision model for descriptions.This would also apply to XLSX and PPTX files that contain embedded images/charts.
Workaround
Using
to_document()to get the asset bytes and processing them separately works, though without positional information it's hard to associate an image with the surrounding content.