markitdown icon indicating copy to clipboard operation
markitdown copied to clipboard

Pdf file conversion not wokring when pdf file is non scanable

Open akashAD98 opened this issue 1 year ago • 2 comments

is therea any plan to add support for this.when pdf is not scnable its not working.

looking for something like this OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched

akashAD98 avatar Mar 25 '25 08:03 akashAD98

same, no error but also no ouput....

EldenLordx avatar May 25 '25 06:05 EldenLordx

markitdown doesn't OCR by default — it only extracts text already embedded in the PDF (via pdfminer.six). A scanned/image-only PDF has no text layer, so conversion succeeds with empty output and no error — that's the "no error but also no output" behavior above.

As of the markitdown-ocr plugin (merged in #1541), there's built-in support for this now:

pip install markitdown-ocr openai
markitdown document.pdf --use-plugins --llm-client openai --llm-model gpt-4o

or via the Python API:

from markitdown import MarkItDown
from openai import OpenAI

md = MarkItDown(enable_plugins=True, llm_client=OpenAI(), llm_model="gpt-4o")
result = md.convert("scanned.pdf")

It uses an LLM vision call (any OpenAI-compatible client, including Azure OpenAI) to OCR scanned pages instead of a traditional OCR engine, so there's no extra binary dependency. See packages/markitdown-ocr/README.md for more.

AndrewAvery7 avatar Aug 19 '26 18:08 AndrewAvery7