How do you programmatically redact PDF FIles?

前端 未结 4 1038
再見小時候
再見小時候 2021-01-02 22:02

Adobe Acrobat has the ability to redact PDF files (that is, actually remove the information, rather than simply drawing a black box on top of it). I would like to use this f

4条回答
  •  醉酒成梦
    2021-01-02 22:22

    You can use GroupDocs.Redaction for .NET to programmatically redact text in the PDF documents. You can perform the exact phrase, case-sensitive and regular expression redaction of the text. This is how you can perform the exact phrase redaction.

    using (Document doc = Redactor.Load("D:\\candy.pdf"))
    {
         doc.RedactWith(new ExactPhraseRedaction("candy", new ReplacementOptions("[redacted]")));
         // Save the document to "*_Redacted.*" file.
         doc.Save(new SaveOptions() { AddSuffix = true, RasterizeToPDF = false }); 
    } 
    

    Disclosure: I work as Developer Evangelist at GroupDocs.

提交回复
热议问题