Blacken/ Annonymiing Text in pdf document Redact Method throws Out of Range Exception


#1

Dear support team,
if I anonymizing this document for example with the Aspose.Pdf.Rectangle(55,56,540,802) the Redact-Method throws an out of range Exception.
Anonymizing Text throws out of Range Exception.pdf (11.5 KB)

Sample Code:
var asposeRect = new Aspose.Pdf.Rectangle(55,56,540,802);
// page is the document I attached
var redactAnnot = new RedactionAnnotation(page, asposeRect)
{
FillColor = Aspose.Pdf.Color.Black,
Color = Aspose.Pdf.Color.Black,

                    Repeat = true
                };

                page.Annotations.Add(redactAnnot);

                redactAnnot.Redact();

Can you tell me why?


#2

@christian.schmidt.lf

Thank you for contacting support.

We have worked with the data shared by you and have been able to reproduce the issue in our environment. A ticket with ID PDFNET-45062 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

However, until this issue is investigated, you may use Flatten method instead of Redact method as in the line of code below; and then share your kind feedback with us.

redactAnnot.Flatten();

We are sorry for the inconvenience.


#3

If I use the Flatten()-Mehtod, I can read the text under the blacken section after I copy and paste the words and phrases to an editor by choice.

But I need to anonymize the words and phrases under the blacken section so that noone can read or copy and paste them.


#4

@christian.schmidt.lf

In that scenario, we are afraid that you would need to wait until the problem with Redact method is rectified.

We are sorry for the inconvenience.