I am trying to redact “The” keyword from this document using ExactPhraseRedaction. But this is giving me OutOfMemoryException and after debugging for a while I noticed that memory consumption was more than 6 Gb for this one page PDF document when I tried to redact it.
here is the sample doc: ErrorFile.pdf (513.9 KB)
We cannot reproduce this issue at our end using following code and latest (23.1) API version:
//C# code to redact a PDF file
using (Redactor redactor = new Redactor(@"D:/ErrorFile.pdf"))
{
RedactorChangeLog result = redactor.Apply(new ExactPhraseRedaction("the", new ReplacementOptions("[personal]")));
if (result.Status != RedactionStatus.Failed)
{
redactor.Save();
};
}
Please take a look at these source and output.zip (1.8 MB) files.
Could you please share following details and we’ll further investigate:
- API version that you are using
- Sample application using that issue could be reproduced
- .NET version
@atir.tahir This is also being reproduced at your end, look at the output file you uploaded and you will see that it is not redacted, actually what happens is that the RedactionStatus is Failed and if you look into RedactLogEntry you will see that redaction is failed due to OutOfMemory Exception.
Please take a look at this screenshot.png (115.9 KB). We redacted “The” with “[personal]”. And this change is reflected in the output PDF.
@atir.tahir I verified and found that this is only being reproduce when replacement options is a color not a text.
new ExactPhraseRedaction(“The” , new ReplacementOptions(Color.Black))
@atir.tahir
//C# code to redact a PDF file
using (Redactor redactor = new Redactor(@“D:/ErrorFile.pdf”))
{
RedactorChangeLog result = redactor.Apply(new ExactPhraseRedaction(“the”, new ReplacementOptions(Color.Black)));
if (result.Status != RedactionStatus.Failed)
{
redactor.Save();
};
}
use this code to redact document
We tried to reproduce this issue using latest API version 23.1. However, there was a different issue (output was not generated at all when we did color replacement. But it worked fine when we did text replacement. Therefore, we have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): REDACTIONNET-424
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@atir.tahir Actually the reason for the output not being created can be easily debugged by looking at the “RedactorChangeLog result” details
The issues you have found earlier (filed as REDACTIONNET-424) have been fixed in this update. This message was posted using Bugs notification tool by atir.tahir
@atir.tahir I am using GroupDocs.Total, when will this update be added in GroupDocs.Total. I mean which version of GroupDocs.Total will include GroupDocs.Redaction V23.3 as it is not included in GroupDocs.Total v23.3.0.
New version of GroupDocs.Total is expected to be released by next week and GroupDocs.Redaction 23.3 will be included in it. As we have any further update, we’ll notify you.