Hello there,
I have come across an issue in my development project involving document redaction with GroupDocs.Redaction. When I include the GroupDocs.Redaction library in my project, the redaction of documents functions as expected. However, when I add a reference to the Aspose.PDF library (version 22.8.0 and onwards), the redaction process fails.
Below are the details of my scenario:
Below are the details of my scenario:
Environment:
- GroupDocs.Redaction version: 23.3.0
- Aspose.PDF version: (Starting from 22.8.0 and onwards)
Source code
using GroupDocs.Redaction.Redactions;
using GroupDocs.Redaction;
using static System.Drawing.Color;
using FileStream stream = File.OpenRead("input.pdf");
using var redactor = new Redactor(stream);
var log = redactor.Apply(new ExactPhraseRedaction("Boring", new(Black)));
Console.WriteLine(log.Status);
foreach (var redactionLog in log.RedactionLog)
{
Console.WriteLine($"{redactionLog.Redaction.Description} [{redactionLog.Result.Status}] : {redactionLog.Result.ErrorMessage}");
}
using (FileStream fsOutput = File.OpenWrite("output.pdf"))
redactor.Save(fsOutput, new() { Enabled = false });
Reproduction Steps:
- Create a project with GroupDocs.Redaction. Perform redaction on a sample PDF document.
- Add a reference to Aspose.PDF (version 22.8.0 or later).
- Perform the same redaction process.
Expected Result: The redaction process should work without any issues after adding a reference to Aspose.PDF.
Applied
ExactPhraseRedaction (searching for "Boring") [Applied] :
Actual Result: The redaction process fails after adding a reference to Aspose.PDF (version 22.8.0 or later).
Failed
ExactPhraseRedaction (searching for "Boring") [Failed] : System.MissingMethodException: Method not found: 'Void Aspose.Pdf.Rectangle..ctor(Double, Double, Double, Double)'.
at .(TextFragment , Color )
at .ReplaceText(Regex , ReplacementOptions )
Input PDF:
embedded.pdf (3.0 KB)