← All articles

Tools11 min read

How to convert a scanned PDF to editable Word text and check the table

Convert a scanned PDF to a Word document with OCR. Two local engines read the same Russian delivery sheet. Download the scans, raw text and a checked DOCX with editable cells.

Igor Karmazin · AI Technical Product Operations

Scan to Word

To turn a scanned PDF into an editable Word document, run optical character recognition (OCR) on the page image and save the resulting text as a DOCX. That may be enough for a letter. For an invoice or delivery note, there is another job: check that each amount belongs to the right item and that the identifier still contains the original characters. In our test, a document number looked right on screen but could no longer be found by an exact search.

If you need one file today, start with the text check and the desktop or browser options below. If you have a folder of similar forms, try the downloadable exercise. It contains two image-only PDFs, four raw OCR transcripts, an editable Word draft and a separate checked document with a native Word table. The names and transaction details are fictional. Download the scans and Word examples.

Find out what is actually inside the PDF

Open a page that contains a surname or a distinctive document number. Select one line, copy it into a plain-text editor and compare it with the page. Then search the PDF for an uncommon word. If the copied text is readable and in the right order, try opening the PDF in desktop Word first. Running fresh OCR on text that was already correct can introduce new errors.

If the entire page selects as one rectangle, the search finds nothing and you cannot paste a sentence, the file is probably a scan. There is also a middle case: you can select a line, but the pasted characters make little sense. The PDF may already have an unreliable text layer. Some viewers recognise letters in images themselves, so the ability to select a word in one application does not establish that the text is stored in the PDF.

We checked the supplied source independently. Running pdftotext scan.pdf - with Poppler returned zero words. The text was plainly visible to a reader. Check more than the first page of a mixed document: a cover exported from Word can be followed by ten photographed attachments. Only the pages with missing or unusable text need fresh recognition.

Two ways to get a DOCX without using the terminal

If you have desktop Microsoft Word, make a copy of the PDF. Choose File → Open, select the copy and confirm the conversion. Click inside a paragraph and try replacing one word. Save the result as a DOCX, close it and reopen it. Microsoft says this conversion is best suited to documents that are mostly text. Expect line breaks and pagination to move. If clicking a word selects a whole-page picture, that part of the output still needs OCR. Microsoft's scan-and-edit instructions.

If the document can go to a cloud service, upload it to Google Drive on a computer. Right-click the file and choose Open with → Google Docs. Once you have the text, use File → Download → Microsoft Word (.docx). Google recommends files of up to 2 MB, upright pages and letters at least ten pixels high for this route. Multi-column text and tables are among the layouts that may change. These two workflows come from the vendors' documentation. The measured comparison below uses two local engines. Google Drive's OCR guidance.

For a one-off letter, try the software you already use. For personnel records, customer prices or private contracts, first check whether uploading that document to the service is permitted. The local workflow below keeps the input on your computer. It requires no subscription to an OCR service.

Two OCR engines, one delivery sheet

Our test sheet contains the Latin document ID KM-0417, a date and a Russian full name. A small table contains two easily confused stock codes, RX-018 and RX-081. Before running either engine, we recorded eight reference values: the document ID, date, name, two stock codes, two line amounts and the grand total. A field counted as correct if its complete value occurred in the output after normalising consecutive whitespace. We preserved the alphabet, digits and spaces within a date. We assessed row associations separately.

We made an image-only PDF with a 1,654 × 2,339-pixel page. A second PDF contained the same page reduced to 620 × 877 pixels, tilted by 2.2 degrees and lightly blurred. Each PDF was rendered to a PNG at 300 dpi for both engines. We ran Tesseract 5.5.3 with Russian plus English and automatic page segmentation. On a Mac we also ran Apple Vision in accurate mode with Russian and English recognition. Tesseract command-line modes · Apple Vision text recognition.

OCR workflow Clean sheet Smaller, tilted copy
Tesseract 7 of 8. The document prefix changed alphabet 4 of 8. The date and both stock codes also changed
Apple Vision 6 of 8. One line amount and the document prefix changed 7 of 8. Both line amounts were present, but their column followed the footer

The trickiest mistake is hard to spot even if you read Russian. The original KM uses Latin K and M. Both engines returned Cyrillic КМ, which looks almost identical in the document font. A database expecting Latin letters treats the strings as different identifiers. On the clean sheet, Vision also turned 3 360,00 into З 360,00. The first character became a Cyrillic letter shaped like the digit three. Software expecting a number might reject or skip that entry.

In the smaller copy, Tesseract inserted a space into the date, producing 03.1 2.2026, and began both stock codes with Cyrillic ВХ. Vision recovered more of the individual values on this version, yet it put the amounts after the “page 1 of 1” footer. This single test cannot rank the engines for other forms or languages. It does show why a useful test needs to ask two questions: did it read the characters, and did it keep the relationships between them?

Run the local PDF-to-Word workflow

The download includes convert_scan.py. It uses pdfinfo to count pages, renders each with pdftoppm, runs Tesseract and writes the recognised lines as editable Word paragraphs. It works through the pages individually and places a Word page break between source pages. We checked the two-page case separately.

  1. Install Python 3, Poppler and Tesseract with the Russian and English language files. On Ubuntu or Debian the relevant packages are normally poppler-utils, tesseract-ocr, tesseract-ocr-rus, tesseract-ocr-eng and python3-venv. Homebrew offers poppler, tesseract and the additional tesseract-lang package for macOS. Windows users can run the Linux workflow in WSL. Tesseract installation · Language data files.
  2. Extract the archive, open a terminal in the scan-to-word directory and run tesseract --list-langs. For this sample you should see both rus and eng. Our Mac initially had only eng and osd. We kept the two language files in a separate directory and passed it using --tessdata-dir. For an English-only form you can pass --lang eng.
  3. Create a Python environment, install the DOCX library and run the conversion. On macOS or Linux the commands below use the executable inside that environment. If the language files are in the standard installation directory, no additional flag is needed.
python3 -m venv .venv
.venv/bin/python -m pip install python-docx==1.2.0
.venv/bin/python convert_scan.py scan.pdf my-copy.docx

Open my-copy.docx and edit a word. It contains ordinary paragraphs you can search and change. The script asks for a fresh output filename, so a second run cannot overwrite your corrected copy. To inspect our result without installing anything, open the supplied raw.docx. How python-docx creates paragraphs and tables.

To reproduce the second engine on a compatible Mac with the Swift command-line tools, make an image with pdftoppm -r 300 -f 1 -l 1 -singlefile -png scan.pdf page. Run swift vision.swift page.png > vision-result.txt. That script saves the lines in the order Vision returned them. The downloadable raw Word document comes from Tesseract and python-docx.

Put the table back together and check the money

Open raw.docx next to the original. The stock codes, quantities and unit prices appear first. The line amounts sit in their own block farther down. Word's “convert text to table” feature cannot infer which of two separate amounts belonged to which row reliably from this arrangement. Insert a four-column table and transfer one complete row at a time while looking at the page image. We did this separately in checked.docx. You can tab from the stock code to the quantity and edit a single cell.

The first row should give 12 × 315.50 = 3,786.00. The second gives 7 × 480.00 = 3,360.00. The total is 7,146.00, printed on the Russian sheet as 7 146,00. As a quick check on your review method, mentally swap the two line amounts. The grand total will still match even though both rows are wrong. Recalculating each line catches a mistake that checking the bottom of the page cannot. For longer statements, a spreadsheet can handle that comparison. Worked example of checking figures in Excel.

If the text will feed a document search system, retain a link to the original PDF and its page number. A reader can then check a quoted sentence and someone reviewing a mismatch can recover the row from the scan. For recurring forms, flag a record for review when its stock code is absent from the catalogue or a line amount fails the calculation. Try the rule on representative anonymised samples before connecting it to a live workflow. How document search with RAG works · Business process automation.

Improve the result before changing tools

Zoom into the source first. Upscaling a picture to 300 dpi makes the OCR input larger, but it cannot reconstruct a letter hidden under a stamp. If you still have the paper, a fresh straight scan often saves more effort than another conversion. For a phone photo, flatten the page, keep all four corners visible and move glare away from the figures. Apply rotation or perspective correction to a copy. Tesseract's image-quality guidance.

Next, look for a pattern. If nearly all Russian text is garbled, check the installed languages. If only stock codes change, test the character set and compare with your catalogue. If the characters are right but their order is wrong, extract the table separately or review a cropped region. A language model may suggest a plausible spelling. Only the original form or the system that issued the identifier can confirm it.

FAQ

Can I convert a scanned PDF to Word for free, without an account?

Yes. Poppler, Tesseract and python-docx run locally. Once the software and languages are installed, recognition does not need an internet connection. Your main costs are setup time, computing and review. For a few pages containing private information, that trade-off may make sense even if you already have a cloud account.

Why does search work in the PDF when Word still shows a picture?

A PDF can have an invisible text layer over a page photograph. That is enough for search, while Word still may have no useful paragraph boundaries or table cells to work with. Copy one line to a plain-text editor. Then check whether individual cells are selectable in your final DOCX if the table matters.

How should a team choose an OCR tool?

Use examples of your own documents: clean pages, phone photos, stamped forms and tables split across pages. Write down the critical fields and how a reviewer should handle uncertain ones. Compare the number of records that pass without correction and the minutes a person spends checking the others. Those measures are more relevant to the purchase than a single headline accuracy figure.

Read on Telegram