Get text out of a scanned PDF with Docling OCR
Turn a one-page image PDF into Markdown, then check three values against the scan.
Last updated
Menus and supported features can change. Compare the source-check date below with your current app version.

You can read the words on a scanned PDF and still be unable to copy them. If the page is stored as a picture, the file may contain no text for a PDF reader to select. In this exercise you will use Docling to recognise the writing in one image-only PDF and save it in a separate Markdown file. OCR means recognising written characters in an image.
Use this when you need to search a scanned notice or pull a few references out of an old document. The useful part is keeping an editable copy you can check against the original. OCR can misread letters and digits, so treat the text as a first pass. This guide follows Docling 2.155.0’s documentation. I checked that the practice PDF has no extractable text layer, but did not run Docling on it. The cover is explanatory.
1. Download the scan and know what you are looking for
Save the practice scan in a new folder. Open the file in your PDF reader. Look for BK-2047, 12 notebooks, and 09:30. Those words are pixels in the practice file, even if a reader with its own OCR makes them look selectable. It helps to know the three values before opening an export. Otherwise a convincing near miss can look correct.
2. Install and run Docling in the practice folder
Install Python 3.12 from its official download page. Open PowerShell, or Terminal on macOS or Linux. Run cd "path to folder", replacing the quoted text with your own folder path. Use dir or ls to check that the PDF is there. Run the following block for your operating system one line at a time.
Windows
py -3.12 -m venv .venv
.\.venv\Scripts\python.exe -m pip install "docling==2.155.0"
.\.venv\Scripts\docling.exe convert "market-scan.pdf" --ocr-mode full_page --ocr-engine easyocr --ocr-lang en --to md --output-file "market-ocr.md"
macOS or Linux
python3.12 -m venv .venv
.venv/bin/python -m pip install "docling==2.155.0"
.venv/bin/docling convert "market-scan.pdf" --ocr-mode full_page --ocr-engine easyocr --ocr-lang en --to md --output-file "market-ocr.md"
The first two lines keep Docling and its dependencies in a separate environment. The final line requests OCR over the entire page, using EasyOCR with English selected. Change languages only after checking the engine’s language codes and testing a small input. The first use may download model files. This command reads a local PDF; it does not name a remote conversion service.
3. Compare the text to the image
Open market-ocr.md in a plain text editor. Match the order code, quantity, and pickup time to the corresponding lines in the PDF. Look closely at zeros and letters: BK-2O47 is not the same order code. Check the colon in 09:30, and whether the quantity is attached to the right item.
An export can have different line breaks from the scan. That matters less than a changed identifier or amount. Keep the original PDF. If you make corrections, use a new text file and mark any part you cannot read instead of guessing it. The exercise is complete when you can close and reopen the Markdown file and recover all three values accurately.
If the page is missing or the export is blank
Read the last error from the terminal. Check the input filename and working folder before reinstalling. If the program rejects the full_page option, check that you installed the version in the exercise. If the program runs but misses text, look at the original page’s resolution, rotation, contrast and language. Test one clear page before trying an entire archive. For a PDF with selectable text, see the existing Docling starter guide.