Only allow visible text with text selection tool

Is there any way to only allow selection of visible text with the text selection tool of the WinForms PDFView control? Many of the PDFs we come across have invisible/hidden text as markers which we extract and use for searching. This text is usually located just behind and offset from some visible text, which makes it easy to select the hidden text instead of the visible text. When this happens the user gets something unexpected as the selected text. We can’t remove the hidden text as we currently use it.



Is it possible to get an example PDF so we can review? If you cannot post here, you can create a ticket here:

The main issue, is that many PDF files are from a Scanner/Optical Character Recognition (OCR) and so the selectable text is actually invisible text overlayed on top of the image from the scanner that contains the visible text, in which case users would want to select/search that text.

This text is usually located just behind and offset from some visible text

Are you generating these PDF files?

This sounds like poor PDF generation from whatever software is generating the PDF files. I assume this is for some sort of shadow effect, in which case, this offset text should have been converted into its raw vector paths, so it still vector, and looks like text at all zoom levels, but is not selectable/searchable.

Hi Ryan,

We’re not producing the PDFs, and in most cases the extra text isn’t for a shadow effect but actually for bookmarking (there’s a call to a JavaScript FindWord function that locates the hidden text in the document). I’ll make a request and submit an example document though that rather than here.