We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Delete content prior to given search string

I am attempting to delete all content prior to a given search string. I tried using the TextAbsorber with a regex and it only gets segments of the text, not all the content.

Regex used was .*somesearchstring

Hi Evan,


Thanks for contacting support.

In order to remove all Textual contents from PDF file, you need to perform text search inside PDF file using RegularExpression and then replace individual textsegment with blank characters. In order to search segments inside PDF file, please try using following regular expression.

TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber(@"[\S]+");


For further details, please visit Replace Text Based on a Regular Expression

In case you still face any issue, please share the input PDF file and code snippet, so that we can test the 
scenario in our environment. We are sorry for your inconvenience.