BookTranslator
BookTranslator

PDF Copy-Paste Gives Wrong Text? Diagnose the Text Layer First

A PDF can look correct but copy the wrong words or numbers. Use four sample files to identify text-layer problems and choose a repair you can verify.

BookTranslator

BookTranslator Team

9 min read

If a PDF looks correct but pastes the wrong text, stop using the pasted version as your source. First compare a short passage with the visible page: a name, a sentence, and a number. The next step depends on whether the file has no extractable text, incorrect character mappings, an inaccurate hidden OCR layer, or a reading-order problem. Running OCR over the whole document is not the right first move for all four.

The most dangerous error is not gibberish. It is plausible text: a page that says 18 notebooks while the extracted text says 13 notebooks. We created four downloadable PDFs to make that distinction observable, without using anyone's private documents.

Start with a small copy-and-compare check

Keep the original file unchanged and open a working copy. Paste one short selection into a plain-text editor, then compare it character by character with the page. Repeat on a different page and, if available, in a second PDF reader. This is a diagnostic check, not proof that the rest of the document is correct.

What happensWhat to investigateFirst useful action
Nothing selects, or the paste is emptyThe page may contain only an imageCheck whether the reader is selecting the page image rather than text
Letters change consistently, although they look normal on the pageCharacter encoding or extraction mappingCompare another reader's output; look for an original source file or a better export
Most words are readable, but names or numbers are wrongAn inaccurate text layer, including old OCRCompare the extracted passage against the visible scan
Letters are right, but columns, captions, or footnotes appear in the wrong orderLayout and reading-order extractionTest a single column or paragraph separately
Copy is disabledDocument permissions or reader behaviorCheck the file's permissions and ask the source for a usable copy

These are clues, not a way to identify every PDF's internals from one symptom. Adobe's content-reuse guidance distinguishes image-only content from copy restrictions. Neither should be treated automatically as a damaged text layer. The pypdf extraction guide separately describes images, text extraction, and difficulties with tables and spacing.

For a long book or report, record the PDF page number where each problem occurs. A clean title page does not tell you whether an appendix, scanned insert, or two-column chapter will copy correctly.

Four PDFs: what the page shows versus what extraction returns

Our test page contains four original lines, including:

The archive contains 18 notebooks.

Item B-204 arrived on 6 May.

We made one normal digital PDF and deliberately constructed three alternatives. Then we extracted their text with Poppler and pypdf. Both extractors returned the same text for each file in this test.

Download the PDFHow we constructed itActual extracted result
Correct digital textNormal visible text with an embedded font18 notebooks; B-204; 6 May
Wrong Unicode mappingChanged the extraction mapping, without changing the visible glyphs13 notebooks; several lowercase a characters became x
Wrong hidden textPlaced deliberately incorrect invisible text over a page image13 notebooks; B-2O4; 8 May
Image-only pageUsed the same page image with no text layerEmpty text output

A normal-looking digital page can copy incorrectly

The first two PDFs rendered to identical pixels in our comparison, yet their extracted text differed. In the second file, we deliberately changed a ToUnicode mapping: information used to map stored character codes to Unicode text. The visible numeral remained 8, while extraction returned 3. The pypdf CMap documentation illustrates this mapping mechanism.

This demonstrates one failure mechanism, not a claim that every garbled PDF has the same defect. A missing ToUnicode entry alone is not our diagnosis, and editing mappings by hand is not a general reader-facing repair.

A searchable scan can contain the wrong words

The third and fourth PDFs also rendered identically to each other. One contained wrong invisible text; the other contained none. In the third file, extraction silently changed both a quantity and a date. The code B-2O4 contained the letter O, not the numeral 0 shown in the image.

We inserted those errors ourselves to represent the kind of mismatch a hidden text layer can contain. An OCR engine did not generate them. The fourth file shows the opposite condition: a readable page image with nothing for these text extractors to return. That is consistent with pypdf's documented limitation: it extracts existing PDF text; it does not recognize words inside images.

What this test establishes—and what it does not

On September 10, 2026, we checked four one-page files using Poppler 26.08.0 and pypdf 6.10.0. Visual comparisons used Poppler at 144 dpi. Pixel equality held within the two pairs, not across all four files: the image-based pair went through an additional rendering step.

This is a controlled demonstration, not an OCR accuracy benchmark. It does not test multilingual recognition, complex layouts, Acrobat repair, OCRmyPDF repair, or BookTranslator uploads. These were constructed examples with known faults, not a blinded assessment.

The raw text and pixel results, reproduction instructions, and generator are available with the files. They use an unmodified Noto Sans font with its included open font license.

Choose the least disruptive next step

The following repair routes come from official documentation and practical diagnosis. They are not repair results from our four-file experiment. Work on a copy and verify the output before replacing anything you rely on.

If you have the source document, try a new export first

A fresh PDF from the original word-processing, publishing, or typesetting file is a useful first candidate. Compare exactly the passage that failed. Do not assume a new filename or a successful export means its text is now correct.

For material obtained from an archive or publisher, check whether an alternative text-bearing version exists. Keep the edition and page references aligned: a cleaner file of a different edition may not preserve the passage you need.

If a scan has a few recognition errors, review those words

Acrobat documents a workflow under Scan & OCR → Correct recognized text. It lets you review flagged suspect words against the scanned image and correct the recognized text. Follow Adobe's current correction instructions for the interface in your version.

Do not use an empty suspect list as a completeness test. Independently compare the names, dates, identifiers, and quantities you will quote or translate. Our deliberately wrong 13 notebooks example shows why readable output is not enough.

If the hidden text is broadly wrong, distinguish redo from force

For readers who use command-line tools, OCRmyPDF documents different paths for pages that already contain text:

  • --redo-ocr removes existing non-printing OCR text and recognizes again while excluding printable text from OCR.
  • --skip-text skips pages containing text. That is not a repair for an existing wrong text layer.
  • --force-ocr rasterizes page content and runs OCR on the resulting images.

These behaviors are described in OCRmyPDF's existing-text error documentation. In version 17, the equivalent choices are also available through --mode; the older flags remain aliases.

There are costs and exceptions. Redo cannot identify every historical OCR arrangement; some files place an opaque image over text that is technically printable. Force turns printable text and vector content into pixels and flattens interactive content. Redo and force also discard an existing structure tree rather than reconstructing it. Review OCRmyPDF's advanced documentation before choosing either.

A repaired extract is therefore not an accessibility pass. If the document needs headings, reading order, or accessible figures, use the separate translated PDF accessibility checks.

If pages or languages differ, do not assume one setting fits

List which pages already contain trustworthy digital text and which need recognition. Check the languages on the affected pages before configuring OCR. Our mixed-language PDF OCR guide covers language selection; it is a different decision from determining whether an old text layer is wrong.

If there is no text layer at all, move to the scanned PDF workflow. Repeatedly trying another plain text extractor will not make pypdf recognize words in an image.

Verify the replacement text before using it

Use the downloadable text-layer check sheet to keep the visible reference, previous extraction, and replacement extraction side by side. Start with the known failure, then test a different passage and any distinctly different page layout.

  1. Words: compare names and unfamiliar terms letter by letter.
  2. Numbers: check quantities, decimal points, dates, and identifiers such as B-204.
  3. Order: read a complete paragraph across line breaks; check columns and nearby captions separately.
  4. Coverage: confirm that pages and passages you need were not omitted.
  5. File behavior: reopen the saved replacement and repeat the copy test. If you depend on bookmarks, links, or accessible structure, check those too.

Passing selected passages gives evidence about those passages. It does not certify the whole file. Preserve the original page image as the reference, especially when correcting a quotation or an unfamiliar language.

Translate only after you can trust the source

If your goal was to quote a paragraph or take notes, a verified extract may be the endpoint. You do not need a translation service to fix that task.

If you need to read the whole document in another language, use the verified file as your starting point for PDF translation. BookTranslator's OCR Mode rebuilds a translated PDF from recognized content; it is not a promise to repair any existing text layer or reproduce the original page layout exactly.

Keep the reference pages through the translation step. The same quantities and identifiers checked here belong in the final PDF translation QA pass. A fluent translation cannot, by itself, tell you that its source should have said 18 rather than 13.

مقالات ذات صلة