FastBankConvertFastBankConvert home

PDF Text Layer Misaligned? Why Copies Come Out Wrong

By FastBankConvertPublished October 17, 2026

When a PDF text layer is misaligned, the hidden OCR text in a scanned file sits in a different place from the image you see. Copying grabs the wrong words, searches highlight blank space, and converters put values in the wrong rows or columns. The fix is to remove the old layer and run OCR again on a straightened page.

What is an OCR text layer, and how does it drift?

An OCR text layer is invisible text placed over a scanned page image. A scanner or OCR tool recognizes the characters in the image and writes them into the file at the positions where they appear, so you can search and copy a picture. The layer drifts when those positions stop matching the image underneath.

On a good searchable scan, each recognized word sits exactly over its image. Select a word and the highlight covers it. Copy a line and you get that line. Converters rely on the same positions: they decide which row and column a value belongs to from where its text sits on the page.

Drift has a few common causes:

  • The image changed after OCR. A page that was rotated, cropped, deskewed or resized after recognition keeps its old text positions, while the picture moves.
  • The OCR ran on a skewed page. If the scan was tilted, the tool may have placed lines on a straight grid that does not follow the tilted text.
  • Two tools disagreed on page size. A file passed between programs can end up with the text layer scaled to a different page box from the image.
  • Layers stacked up. A page OCRed twice can carry two text layers, one aligned and one not.

None of this shows on screen, because the text layer is invisible. You see a normal scan. Only selecting, searching or converting reveals that the text underneath is in the wrong place.

Signs of a misaligned PDF text layer

A misaligned PDF text layer shows itself when you use the text, not when you look at it. Highlights that sit beside or below the words, search hits that land on blank space, and copied text from the next line are the usual signs. The scan looks perfect while every interaction with it goes slightly wrong.

Look for these on screen:

  • Offset highlights. Selecting a word draws the highlight a little above, below or to the side of it.
  • Growing offset. The highlight is close at the top of the page and further off at the bottom, or the reverse. That points to a scale or skew difference.
  • Search in the wrong spot. A search for an amount finds it, but the highlight lands on another line or on white space.
  • Copy from a neighbour. Copying one transaction gives the line above or below, or half of each.
  • Partial selections. You can select only part of a column, because the layer's text runs at a slight angle across the rows.

A misaligned layer is different from a bad one. A bad layer has the wrong characters, such as an 8 where the page shows a 3. A misaligned layer can have every character right but in the wrong place. Both can happen together on a poor scan.

Why does a misaligned text layer scramble Excel columns?

A misaligned text layer scrambles Excel columns because converters assign values to rows and columns by position. If the hidden text sits a few points off, an amount can fall into the balance column, a date can join the row above, and a description can split across two rows. The characters are right, but their places are wrong.

Think of a statement row as a set of boxes. The converter draws invisible boundaries between the date, description, amount and balance columns, and between one transaction and the next. Each piece of text goes in the box it lands in. On an aligned layer, every value lands in its own box. On a drifted layer, values near a boundary cross it.

The effect is uneven down the page:

  • A constant offset moves everything the same distance, so a converter that finds the columns from the text itself may still cope.
  • A skew shifts values more as you go down or across the page, so the top rows convert well and the bottom rows mix.
  • A scale difference spreads or squeezes the text, so the right-hand columns drift further than the left.

Skew and scale are the hard cases. They put each row's values on a slight slant, so a converter reading straight lines picks up parts of two transactions in one row. The sum of the amount column may still be right while every individual row is wrong.

How do you test a scanned PDF's text layer?

You test a scanned PDF's text layer by copying one line near the top and one near the bottom of a page, then comparing the paste with what you see. If both pastes match their lines and the highlights sit on the words, the layer is aligned. If the bottom paste picks up a neighbouring line, it has drifted.

Here is a worked test on one example statement page. The values are invented for illustration.

Step What you do What you see (example) What it tells you
1 Select the first transaction line Highlight sits over the words Top of page is aligned
2 Copy and paste it into a text editor 03/02 GROCERY MART 54.18 2,145.82 Characters and order are right
3 Select a line near the bottom Highlight sits half a line below the words The layer drifts down the page
4 Copy and paste that line 03/27 PAYROLL DEPOSIT 03/28 CARD PMT Two transactions merged, amounts missing
5 Search for an amount from line 4, such as 1,980.00 Hit lands on the next line Positions, not characters, are off

The verdict for this example: the characters are recognized correctly, but the layer drifts towards the bottom of the page. A converter would mix rows on the lower half. The layer needs redoing.

Run the test on more than one page. Drift often differs from page to page, because each page was scanned at its own small angle.

Redoing the OCR text layer properly

Redoing the OCR text layer means removing the old hidden text and recognizing the page again, after straightening it. The order matters: deskew and crop first, then OCR, so the new layer is placed on the final image. Doing any image change after OCR is what causes drift in the first place.

Use an OCR tool that can replace an existing layer rather than add a second one. The free OCRmyPDF tool documents three choices in its guide to OCRmyPDF errors and existing text:

  • Redo OCR. It finds existing hidden OCR text, removes it and runs OCR again, while leaving printable digital text alone. This suits a scan whose old layer has drifted.
  • Force OCR. It turns all page content into images and recognizes them. The guide suggests it after a failed earlier OCR pass. It also turns any real digital text into OCR text, so use it only on pages that are scans anyway.
  • Skip text. It leaves any page that already has text untouched. That keeps a bad layer, so it is the wrong choice here.

Prepare the image before the new pass. The Tesseract OCR engine's guide to improving OCR quality recommends rotating a skewed page so the text lines are horizontal, and says Tesseract works best on images of at least 300 DPI. It also warns that very large borders can cause problems and suggests cropping to the text area with a modest margin.

Put together, a sound redo looks like this:

  1. Keep the original file in case the redo makes things worse.
  2. Deskew and crop the page images so the text runs straight.
  3. Check the resolution. If the scan is far below 300 DPI, rescanning may help more than any setting.
  4. Run OCR with the option that removes the old layer.
  5. Repeat the top and bottom copy test on a few pages.
  6. Do not rotate, crop or resize again after this step.

FastBankConvert is built for statements, scanned ones included, though scans take longer than digital files, and it tells you before you download if the balances do not add up, which is how a row mixed up by a bad layer tends to surface. You can get started with FastBankConvert to hear when trial conversions open.

Text layer faults that look like other copy problems

Several copy problems look like a misaligned text layer but have other causes. Doubled letters, words run together without spaces, and lost minus signs all come from how the text was written, not where it sits. The test is simple: if the highlight sits on the words, the layer is aligned and the problem is something else.

Compare the symptoms:

A misaligned layer can also cause the last problem by accident. If a closing parenthesis drifts onto the next row, the amount left behind has an opening bracket only. When parentheses go missing in only some rows near the bottom of a page, test the layer before you blame the format.

When the existing OCR text layer is worth keeping

The existing OCR text layer is worth keeping when its drift is small and constant and its characters are accurate. A new OCR pass carries its own risk of misread digits, so replacing a layer that recognized every amount correctly can make the data worse. Keep it if the test shows only a slight, even offset.

Keep the layer, or at least try it first, when:

  • The offset is the same on every line. A converter that reads columns from the text itself often copes with an even shift.
  • The scan quality is poor. If the original OCR was done from a better image than you now have, a new pass on the worse image will read less.
  • The file is a record. If the searchable PDF is the version that was filed or sent, keep it unchanged and work from a copy.
  • You need only a few values. Copying three amounts by hand is quicker than redoing the OCR.

Redo the layer when the drift grows down the page, when rows merge in the copy test, or when the file has two text layers. Those cases do not improve with cleanup in the spreadsheet.

All posts in Difficult and locked PDFs