markitdown icon indicating copy to clipboard operation
markitdown copied to clipboard

feat: add DocConverter for legacy .doc files using unword parser

Open yousrae2004 opened this issue 6 months ago • 1 comments

Closes #23 Closes #56 (Note: This PR includes both contributions to these issues as I forgot to open a new branch)

Summary

Issue 23 - Adds support for converting Microsoft Word .doc files (Word 97-2003 OLE format) to Markdown. Uses the unword library as parser backend to extract body text with heading levels, page breaks, and textbox contents.

Issue 56 - Extracts and saves images to disk when using pptx files, and are saved to the current directory by default, or a custom directory via the output_dir kwarg.

Changes

1. .doc File Support

  • Added _doc_converter.py with a new DocConverter class
  • Registered DocConverter in converters/__init__.py and _markitdown.py
  • Added test.doc test file and test vector in _test_vectors.py

2. PPTX Image Extraction

  • Made changes to _pptx_converter.py to save image blobs to disk using the correct file extension from the image content type.
  • Edited test vector for pptx converter in _test_vectors.py

Testing

All local tests pass

yousrae2004 avatar May 09 '26 02:05 yousrae2004

@microsoft-github-policy-service agree

yousrae2004 avatar May 09 '26 21:05 yousrae2004