How to Fix Gaps in PDF Text Highlighting and Underlining
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.

- 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.
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.
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.
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.
Go to the 'Scan & OCR' or 'Text Recognition' toolset in your application's main menu.
Select 'Recognize Text' and choose the 'Searchable Image (Exact)' setting to ensure the new text layer perfectly matches the visual layout of the document.
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.
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. Open your PDF: Launch WPS Office and open your PDF document using the WPS PDF Editor.
- 2. Select the Highlight Tool: Click on the 'Comment' tab in the top navigation ribbon, then click the 'Highlight' icon.
- 3. Annotate Smoothly: Click and drag your cursor continuously across the sentences or paragraphs you wish to highlight.

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.




