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

Free Support Forum - aspose.com

About textFragment.Rectangle's wrong coordinates

In some cases,“textFragment.Rectangle” does not seem to reflect the real position,resulting big offset. The attached file is the case.
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber(“经济”);
textFragmentAbsorber.TextSearchOptions.IsRegularExpressionUsed = true;
pdfDocument.Pages.Accept(textFragmentAbsorber);
TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;

        foreach (TextFragment textFragment in textFragmentCollection)
        {
           
             
                Aspose.Pdf.Rectangle myrectange;
                myrectange = textFragment.Rectangle;
             

                    RedactionAnnotation ra = new RedactionAnnotation(textFragment.Page, myrectange);
                   

                            textFragment.Page.Annotations.Add(ra);
                            ra.FillColor = textFragment.Page.Background;
                            ra.Color = textFragment.Page.Background;

result.jpg (153.6 KB)

input.pdf (721.6 KB)

@tomgreen

I have been able to reproduce the issue on our end. A ticket with ID PDFNET-49953 has been created in our issue tracking system to further investigate the issue on our end. This thread has been linked with the issue so that you may be notified once the issue will be fixed.