My Project requirement is,
User will draw a rectangle in the pdf page to hide some sensitive content. In this user may draw a rectangle with some extra spaces we have to remove that spaces and shrink the rectangle. To achieve this we have to grab the text under user drawn rectangle and find an exact rectangle of the text and then we have to resize the rectangle as per text.
I am using the com.aspose.pdf.TextAbsorber to find the text under the user drawn rectangle. I got the exact text from the TextAbsorber.
Then, I am using the com.aspose.pdf.TextFragmentAbsorber to search the text and find the Rectangle (coordinates) of the text from the PDF Page. It is working for the normal alphabets and numeric but, I am facing some issues in below cases,
Case 1: when I am try to search with special characters like ((, ) , ?, +), it is not supporting and it is not returning any fragments.
Sample search text:
- Fri, 16 Apr 2021 10:26:58 +0000
- ( for pdf and MS Office files)
Case 2: When a search text has three lines and if it has an empty line in between two lines of text, TextFragmentAbsorber is not working
Case3: When a text has bullet points like we use in word it is not working.
Find the sample pdf file,
Sample pdf file.pdf (109.7 KB)
Kindly help me to resolve this issue.
Thanks,
Nathiya