TextFragmentAbsorber throws exception on some pdf files

We work with the textfragmentabsorber to search for text in pdf files, but in some files we get an nul reference exception.
TextFragmentAbsorber textAbsorberLabel = new TextFragmentAbsorber(OurRegexExpression);
textAbsorberLabel.TextSearchOptions = new Aspose.Pdf.Text.TextSearchOptions(true);
document.Pages.Accept(textAbsorberLabel); -> here the exception is thrown
It only happens with some pdf files, most files are fine.

Thanks for your help
Elke

@CODEX_Entwickler
please attach any of the files with which the error occurs.

I’m sorry, I’m not able to share these files because they are confidential. We found a solution for us: we use another pdf tool to run again an OCR and after that no more exception is thrown by the textfragmentabsorber.

@CODEX_Entwickler
You could try to change the text in the document (using Adobe Acrobat Pro for example)?

Thanks for your help!
After changing something in the pdf with another tool (like acrobat) no more exception is thrown.

We use a workaround now: if the exception appears on one file, we run a ocr scan with another tool and when try it again. It’s not perfect, but it works for us.