Nyxiontech PDF Tools › PDF to text
Why text copied from a PDF pastes as gibberish
The page reads perfectly on screen. You select a paragraph, copy it, paste it into an e-mail, and out comes a run of boxes, accented capitals and punctuation that spells nothing. Your eyes and your clipboard are both working. The letters you can see and the characters the file hands out are simply two different things, and only one of them is broken. This guide shows how to tell which of four problems you have in a single click, why most of the advice you will find does not work, and the one setting that decides whether the real fix does anything at all.
Tell the four cases apart first
Open PDF to text, drop the file on it and click Extract text. What comes back names the problem:
- Readable text. The PDF is fine. Whatever mangled your paste was the program you pasted into, or a selection that caught a different part of the page. Copy it from here instead and you are done.
- "No text found". There is no text in the file at all. It is a scan or a photograph, so the page is pixels and nothing else. The tool says as much and points you at OCR. The fix below is yours.
- The same gibberish. The file does have a text layer, but the part of it that records which letter each code stands for is missing or wrong. This is the case the rest of this guide is about.
- The file will not open. It needs a password before anything can read it, and no tool gets past that without the password. Unlock PDF removes a password from a file you can already open; it does not guess one.
Keep that last one separate from a different thing people call by the same name. A PDF can carry a flag saying that copying is not permitted. A flag is not encryption: the text sits in the file exactly as it does in any other PDF, and whether a program respects the flag is a decision that program makes. So if your paste is gibberish rather than blocked, copy protection is not the reason.
Why the page looks right and the copy does not
A PDF does not store letters. It stores a font and a list of codes, and for every code the font holds a drawing. Code 36 might draw an "a". Nothing in that arrangement has to record that code 36 means the letter a, because drawing the shape never required knowing what it was.
Copying does require knowing. For that, a font can carry a second table, the ToUnicode CMap, which the PDF specification describes as "A stream containing a CMap file that maps character codes to Unicode values" (ISO 32000-2, clause 9). When that table is missing, partial or wrong, the display is untouched, because the display never consulted it. Copying, searching and screen readers are the only things that break, which is exactly the pattern you are seeing.
It usually comes from subset fonts, where whatever produced the file renumbered the codes to suit itself and then wrote no correct table, or from a document that has been through a converter that rebuilt its fonts along the way. Older typesetting output, exports from accounting and banking systems and files that have been converted more than once are the common offenders.
Why the usual advice does not fix it
- Convert the PDF to Word. The converter reads the same text layer through the same broken table and writes the same gibberish into the .docx. Our PDF to Word is no exception, and nor is Word's own PDF import. It only seems to work when the converter quietly gives up on the text layer and recognises the pixels instead, which is the real fix wearing a disguise.
- Change the font in Acrobat. Editing the text changes what gets drawn on the page. It does not write the missing table, and it wants a paid licence before you can even try.
- Open it in another reader. Every reader reads the same entry in the same file. One will occasionally guess the letters from the names the font gives its glyphs and so appear to fix it, which is why this works for one person and not the next. A guess that sometimes lands is not a fix.
- Print it to a new PDF, then run OCR. This one genuinely works, and it is worth seeing why: printing throws the text layer away and leaves pixels behind, and OCR then builds a correct layer from those pixels. The steps below do the same thing without the detour.
The fix: read the pixels, not the text layer
Optical character recognition looks at the page as a picture and works the letters out from their shapes, so the broken table never enters into it. One setting decides whether it happens at all.
- Open OCR: searchable PDF and add the file.
- Untick Skip pages that already contain text. It is ticked by default, and on this file it is the whole problem. The tool counts the characters on each page and skips any page carrying more than twenty of them. Your pages are full of characters. They are the wrong characters, but a count cannot tell, so every page is skipped and nothing happens. You will see it say so, naming the pages: "Skipped 12 page(s) that already had text".
- Set Language to match the document. The choices are Polish + English, which is the default, Polish, and English. Recognition leans heavily on what words look like in a given language, so the wrong setting costs real accuracy.
- Leave Quality on Accurate unless the print is small, where Small print is worth the wait. The settings render the page at 200, 300 and 400 dots per inch before reading it, so each step up is slower.
- Click Recognise text. It runs on your own processor, so a long document takes minutes rather than seconds, and the progress line names the page it is on.
- Click Copy recognised text. That is the text the recogniser produced, and it is the one you came for.
Do not copy out of the PDF it hands back. That file is your original with a new invisible text layer drawn over it, so the broken layer is still underneath, and anything extracting text from it gets both at once: the gibberish and the good text, interleaved. Copy recognised text gives you only what was recognised. This is the step almost every other guide leaves out, and it is why people report that OCR "did not work".
When you need a clean file, not just the text
If you have to pass on a PDF that other people can search and copy from, get rid of the broken layer before recognising anything:
- Open Compress PDF and pick any Level except Lossless. Those levels turn each page into an image, which is normally the cost and is here the point: the broken text layer goes with it. Lossless only repacks the file and would leave the layer exactly where it is.
- Run the result through OCR: searchable PDF. With no text left on the pages, the skip setting no longer changes anything, although there is no harm in leaving it unticked.
There is a price. The pages become pictures, so the text is only ever as sharp as the rendering, and the file may come out larger or smaller depending on what was in it. For a document you only need to read from, copying the recognised text is simpler and gives up nothing.
If what you want is a document you can edit rather than one you can search, PDF to Word builds a .docx instead, and how to convert PDF to Word without uploading it sets out what the conversion keeps and what it drops.
What recognition will not do
- It reads English and Polish. No other language is offered, and running one of them as English gives poor results.
- Columns, tables and forms come back as lines of text in reading order, which is often not the order you wanted them in.
- Handwriting is not recognised.
- Faint print, scanning noise and tight line spacing all cost accuracy. Proofread anything that matters, digits most of all: a misread amount or account number looks perfectly plausible.
- Everything runs in your browser, so nothing is uploaded and nothing is stored, and a long document is limited by your own machine rather than by a queue.
Open PDF to text to find out which case you have, then OCR: searchable PDF to fix it.