PDF Editing Issues

How to Fix Gaps in PDF Text Highlighting and Underlining

Rana GarciaRana Garcia Oct 28, 2026 869 views

Question details

The user wants to achieve continuous text highlighting and underlining across complete sentences and spaces in PDFs, rather than having annotations break between words.

How to Fix Gaps in PDF Text Highlighting and Underlining
Product
PDF Editor
Device & OS
not provided
Scenario
Annotating fully justified text or scanned PDFs where highlighting leaves empty spaces between words.
Observed behavior
The PDF reader highlights or underlines individual words separately, leaving noticeable gaps at spaces and after punctuation, due to fragmented text layers or expanded justification spaces.
Before you start

Ensure you have saved a backup copy of your original PDF document before removing hidden information or re-running OCR processes to avoid accidental data loss.

Solution 1Recommended

Sanitize Document and Re-run OCR

Clear inaccurate text layers from previous OCR attempts and generate a precise searchable image to fix fragmented spaces.

Fragmented highlighting is usually caused by an inaccurate underlying text layer, which often happens in scanned documents or PDFs with fully justified text. Removing the existing OCR data and re-applying it can bridge the gaps between words and punctuation.

1
Remove Hidden Information

Open the PDF in your advanced PDF editor. Navigate to the tools menu and select 'Remove Hidden Information' or 'Sanitize Document' to strip out existing flawed text layers and OCR data.

2
Access OCR Tools

Go to the 'Scan & OCR' or 'Text Recognition' toolset in your application's main menu.

3
Configure OCR Settings

Select 'Recognize Text' and choose the 'Searchable Image (Exact)' setting to ensure the new text layer perfectly matches the visual layout of the document.

4
Run OCR and Test

Apply the OCR process to the entire document. Once finished, use the highlight or underline tool to test if the annotation is now continuous across spaces.

Justified Text Limitation: In some fully justified PDFs, the structural expansion of spaces is built into the document's code. If gaps persist, trying a different PDF viewer can sometimes alter how these highlights render visually.
Seamless PDF Annotation

Use WPS Office for Continuous PDF Highlighting

Experience smooth, gap-free text highlighting and powerful OCR capabilities with WPS Office. It provides an intuitive PDF reading and editing experience, easily handling scanned documents and justified text.

  1. 1. Open your PDF: Launch WPS Office and open your PDF document using the WPS PDF Editor.
  2. 2. Select the Highlight Tool: Click on the 'Comment' tab in the top navigation ribbon, then click the 'Highlight' icon.
  3. 3. Annotate Smoothly: Click and drag your cursor continuously across the sentences or paragraphs you wish to highlight.
Continuous text highlighting without annoying gaps between words.Advanced OCR technology to accurately recognize and map scanned text.Fully compatible with standard PDF formats and Adobe Acrobat files.Lightweight, fast, and completely free to download.
microsoft office alternative - wps office

Frequently Asked Questions

Why does highlighting skip spaces in my PDF?

This occurs when the PDF's text layer is fragmented. It is a common issue caused by poor OCR quality on scanned documents or specific spacing rules applied to fully justified text by the software that created the file.

Does flattening the PDF fix highlighting gaps?

No, flattening a PDF merges existing annotations into the background content but does not restructure the underlying text layer. You will need to re-run OCR to fix the text recognition first.

Can I highlight text in a scanned PDF that hasn't been OCR'd?

Without Optical Character Recognition (OCR), a scanned PDF is essentially just an image. You must run an OCR process first to create a searchable text layer before you can use standard text highlighting tools.

Are there alternative ways to mark up text if the highlight tool fails?

Yes, if the text layer cannot be fixed, you can use the 'Area Highlight' tool or draw a 'Rectangle' shape over the text block and set the fill color to be semi-transparent yellow.