I have tried to implement PDF Redaction But the reference is not found.

Hi,

I was trying to implement the this below link code. But there I am getting PdfRedaction reference is not found. The namespaces are also not found Syncfusion.Pdf.Parsing, Syncfusion.Pdf.Redaction. From NutGet I have added Syncfusion.Pdf.Net.Core reference but still the reference are not found, Please help me what I am missing. .

          using Syncfusion.Pdf;
          using Syncfusion.Pdf.Graphics;
          using Syncfusion.Pdf.Parsing;
          using Syncfusion.Pdf.Redaction;

         public void GetString()
        {
            //Load a PDF document for redaction
            PdfLoadedDocument ldoc = new PdfLoadedDocument("/pdfs/Sample.pdf");
            //Get first page from document
            PdfLoadedPage lpage = ldoc.Pages[0] as PdfLoadedPage;

            //Create PDF redaction for the page
            PdfRedaction redaction = new PdfRedaction(new RectangleF(340, 120, 140, 20));

            //Adds the redaction to loaded 1st page
            lpage.Redactions.Add(redaction);

            //Save the redacted PDF document to disk
            ldoc.Save("RedactedPDF.pdf");

            //Close the document instance
            ldoc.Close(true);
        }

1 Reply 1 reply marked as answer

GK Gowthamraj Kumar Syncfusion Team June 11, 2021 09:24 AM UTC

Hi Somnat, 
 
Thank you for contacting Syncfusion support. 
 
To redact the content from the existing PDF document in .NET Core, you need to include the Syncfusion.Pdf.Imaging.Portable assembly reference in the .NET Core project. Please refer the below link for more information, 
 
Please let us know if you need any further assistance with this. 
 
Regards, 
Gowthamraj K 


Marked as answer
Loader.
Up arrow icon