I use the RedactionAnnotation
class to process PDF documents, but there are several problems in the process of processing, please help me to see why.
Version info:
Aspose.PDF for Net 23.2
Issue 1
The demo code
void Main()
{
var doc = new Aspose.Pdf.Document(@"C:\Users\54390\Desktop\6下第5单元详细考点梳理.pdf");
var color = Aspose.Pdf.Color.White;
foreach (var page in doc.Pages)
{
var annot = new RedactionAnnotation(page, new Aspose.Pdf.Rectangle(0, 0, 200, 200));
annot.FillColor = Aspose.Pdf.Color.White;
annot.Color = Aspose.Pdf.Color.White;
page.Annotations.Add(annot);
annot.Redact();
}
doc.Save(@"C:\Users\54390\Desktop\output.pdf");
}
The demo file
6下第5单元详细考点梳理.pdf (405.8 KB)
The screenshot
20230304161525.png (28.5 KB)
Issue 2
The demo code
void Main()
{
var doc = new Aspose.Pdf.Document(@"C:\Users\54390\Desktop\六年级数学期中试卷(学生版).pdf");
var color = Aspose.Pdf.Color.White;
foreach (var page in doc.Pages)
{
var annot = new RedactionAnnotation(page, new Aspose.Pdf.Rectangle(0, 0, 200, 200));
annot.FillColor = Aspose.Pdf.Color.White;
annot.Color = Aspose.Pdf.Color.White;
page.Annotations.Add(annot);
annot.Redact();
}
doc.Save(@"C:\Users\54390\Desktop\output.pdf");
}
The demo file
六年级数学期中试卷(学生版).pdf (1.6 MB)
The screenshot
20230304161733.png (60.3 KB)
Issue 3
The demo code
void Main()
{
var doc = new Aspose.Pdf.Document(@"C:\Users\54390\Desktop\JGT434-2014 木结构防护木蜡油.pdf");
var color = Aspose.Pdf.Color.White;
foreach (var page in doc.Pages)
{
var annot = new RedactionAnnotation(page, new Aspose.Pdf.Rectangle(0, 0, 200, 200));
annot.FillColor = Aspose.Pdf.Color.White;
annot.Color = Aspose.Pdf.Color.White;
page.Annotations.Add(annot);
annot.Redact();
}
doc.Save(@"C:\Users\54390\Desktop\output.pdf");
}
The demo file
JGT434-2014 木结构防护木蜡油.pdf (2.6 MB)
The screenshot
20230304162013.png (24.7 KB)