← All posts

Converting a scanned PDF to Word needs OCR first

You have a scan — a contract, a form, a chapter someone photocopied — and you need to edit the words in Word. So you ran it through a PDF-to-Word converter. What came back was either an empty document, a document holding one enormous picture of the page, or a page of characters that look like someone sat on the keyboard.

Trying a second converter gives the same result. So does a third. That is not four bad tools in a row. It is four tools correctly reporting that there is nothing there to convert.

The fix is a step you have not done yet, and it has to happen before any converter touches the file.

Why the converter gave you nothing

A PDF does not store a page. It stores instructions for drawing one. For a document produced by Word or a typesetter, those instructions say things like put the letter "M" in Times at 11 point at this coordinate — thousands of them per page. That set of instructions is the text layer, and it is the only thing a converter reads.

A scanner cannot produce any of that. It has a sensor and a lamp. What it produces is a photograph, and the PDF it writes contains one instruction per page: draw this JPEG, full bleed. The words are in the picture the way words are in a holiday snap of a road sign — visible to you, and nothing at all to software.

So a PDF-to-Word converter pointed at a scan finds no characters. The polite ones say so. The rest put the page image into a .doc and hand it back, which is why your Word document contains a photo you cannot type into. Nobody has failed; you have simply asked for words from a file that contains none.

Making those pixels into characters is a separate job with its own name: optical character recognition, OCR. It is a guess made by a model looking at the shapes. That is why it must come first, and why the result needs proofreading.

Confirming it, in thirty seconds and then properly

Open the PDF in any viewer and try to select a sentence with the mouse. If the selection snaps to words, there is a text layer and your problem is something else — four different things stop text being selectable and only one of them is a scan. If dragging draws a plain blue rectangle over the whole page, it is a picture.

That test tells you about the page you happened to open. Long documents are usually mixed: a forty-page report where pages 12 to 14 were scanned and pasted in. Our PDF inspector reads the file in your browser and reports the text layer page by page, along with page sizes and whether the file is encrypted. For a page-by-page verdict from the server, OCR PDF sorts every page into text, picture or blank. How it decides, and the handful of pages it gets wrong, is a subject of its own.

The order that works

  1. Find out which pages actually need it. Run OCR PDF. Long documents are usually part scan and part typed, and running an engine over a page that already has good text makes it worse; working out which pages covers the method and where the character threshold needs moving. Pull the pages that do need it out with Extract PDF pages if they are going anywhere that bills per page.
  2. Straighten the scan before recognising it, not after. Recognition assumes text sits on horizontal lines; two degrees of tilt measurably increases the error rate. Deskew PDF measures the slant of the text lines and turns each page back level. Some engines straighten on their way through, in which case let them do it and skip this step.
  3. Run a real OCR engine over it. OCRmyPDF, Tesseract, Acrobat's Recognise Text, or your scanner's own software — named and compared in the next section. What you want out is the same PDF with an invisible text layer added behind the page image, not a new document.
  4. Check that the text layer took. Re-run OCR PDF or the inspector on the result. It should now report real text on the pages that were pictures. If it does not, the engine wrote a separate text file rather than a searchable PDF.
  5. Now convert. PDF to Word turns the recovered text into editable paragraphs with headings marked up. If you want the words with no formatting at all — to paste into something else, or to run a spell check over — PDF to text gives you a plain UTF-8 .txt.

Which OCR tool to use

Use a proper one. This is the step where free desktop software beats every web converter, including ours.

Getting good recognition out of a bad scan

Recognition quality is decided before the engine runs. If the output is nonsense, the input is usually the reason.

What our converter will not do

Two things worth knowing before you spend an afternoon on this.

Our PDF to Word tool does not write .docx. It produces an HTML document named .doc. Word, LibreOffice Writer, Pages and Google Docs all open it, and one Save As turns it into a real .docx — but Word will first warn you that the format and the extension do not match. That warning is the file being honest about what it is. What survives the trip is paragraphs and headings. Tables, columns, images and exact fonts do not.

Point it at a scan with no text layer and it refuses. It will not hand you a document containing a picture and let you find out later. That refusal is the message telling you the OCR step has not happened yet.

Deskew PDF converts the pages it straightens into images. That is the price of resampling the ink, and it is why deskewing belongs before recognition rather than after — do it the other way round and you will delete the text layer you just paid for.

Then proofread it, especially the numbers

OCR is a guess, and its errors are quiet ones. It will not mangle a word into gibberish you would notice; it will give you a plausible wrong character. 1 and l, 0 and O, 5 and S, rn read as m. A recognised invoice total of £1,058 might have been £1,O58 on paper, and a spell check will not flag either.

So before the document goes anywhere: read every figure, every name, every date and every reference number against the original page. Prose you can skim, because a wrong word reads wrong. Numbers you have to check one at a time.

Tables deserve particular suspicion. OCR recovers the characters but not the grid, so a recognised table arrives as loose text that happens to be arranged in columns — which is a different and harder problem, covered in getting a table out of a PDF and into Excel. If the table is what you are actually after, OCR the page first and then treat it as a table extraction job, not a Word conversion.