How to Start Convert PDF Work with PDF Modules PDF Document PDF Pages Text Image Graph & Path Annotation, Markup & Drawing Redaction Security Digital Signature Forms Watermark Bookmark Link File Attachment File Metadata Printing Work with Other SDKs Barcode read Barcode create OCR Twain

PDF Redaction VB.NET Library
How to Redact PDF Text in VB.NET


Help VB.NET Users to Redact PDF Text to Protect PDF Document in VB.NET









Look for HTML5 PDF Editor?

EdgePDF: ASP.NET PDF Editor is the best HTML5 PDF Editor and ASP.NET PDF Viewer based on XDoc.PDF, JQuery, HTML5. It supports ASP.NET MVC and WebForms projects.


Overview



Before you distribute a PDF, you may want to examine the document for sensitive content or private information that can trace the document to you. RasterEdge XDoc.PDF SDK provides such functions to protect VB.NET users' personal information. This page will show you with VB.NET demo, by using this sample code, you can call the Redact SDK API to remove or redact sensitive text that is visible in a PDF.




Redact PDF Text using VB.NET



This VB.NET coding example shows you how to redact PDF text content.




Dim inputFilePath As String = Program.RootPath + "\\" + "1.pdf"
Dim outputFilePath As String = Program.RootPath + "\\" + "output.pdf"

' open document
Dim doc As PDFDocument = New PDFDocument(inputFilePath)
' get the 3rd page
Dim page As PDFPage = doc.GetPage(2)
' set redact region
Dim region As RectangleF = New RectangleF(100.0F, 100.0F, 300.0F, 300.0F)

' create redaction option
Dim options As RedactionOptions = New RedactionOptions()
options.AreaFillColor = Color.Black

' process redaction
PDFTextHandler.RedactText(page, region, options)
' output file
doc.Save(outputFilePath)