microsoft / microsoft/markitdown

markitdown outputs plain text instead of Markdown when converting PDF

Open
#2,214 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
186k
Forks
13.7k
Avg merge
1d 4h
Merged PRs (30d)
49

Description

Summary

When converting a PDF to Markdown using markitdown, the generated .md file contains only plain text with line breaks and almost no Markdown syntax. Although the output file has a .md extension, headings, lists, tables, and other document structure are not represented using Markdown formatting.

Steps to Reproduce

  1. Install MarkItDown:

    pip install markitdown
    
  2. Convert a PDF:

    markitdown apex.pdf > document.md
    
  3. Open the generated document.md file.

Expected Behavior

I expected the generated file to use Markdown syntax where possible. For example, document titles and section titles should be converted to Markdown headings (#, ##), lists should be preserved as Markdown lists, and tables should be converted to Markdown tables when they can be recognized.

Actual Behavior

The generated file is essentially plain text with line breaks. For example, the beginning of the output looks like:

APEX Subscriptions Schedule

to

Commercial Terms of Sale

Last Updated: November 4, 2024

instead of something like:

# APEX Subscriptions Schedule

## Commercial Terms of Sale

**Last Updated:** November 4, 2024

Environment

  • OS: Windows
  • Python: 3.12
  • MarkItDown version: 0.1.6

Question

Is this the expected behavior for PDF conversion, or is Markdown formatting supposed to be generated when the document structure can be inferred? If this is expected, could the documentation clarify what level of Markdown formatting is supported for PDFs?

Image

PDF USED

https://i.dell.com/sites/csdocuments/Legal_Docs/en/us/apex-subscriptions-schedule-cts-en.pdf

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the markitdown apex.pdf > document.md CLI flow and reproduce the output using the linked PDF. Compare the generated text with the requested headings, lists, tables, and emphasis; done means PDF conversion preserves recognizable document structure as Markdown, with behavior covered by an appropriate regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
content
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.