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 Images in VB.NET


Online VB.NET Guide for Redacting PDF Images to Protect Your PDF Document in Visual Basic .NET Application









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



Text content, images and PDF pages are all supported to be redacted with our .NET PDF SDK. after copy below demo code to your VB.NET project, you can call our image redaction API and quickly redact PDF images to protect confidential information inside the images. Same as text redaction, you can specify custom text to appear over the image redaction area.




How to VB.NET: Redact PDF Images



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




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

' open document
Dim doc As PDFDocument = New PDFDocument(inputFilePath)
' get the 1st page
Dim page As PDFPage = doc.GetPage(0)

Dim images As List(Of PDFImage) = PDFImageHandler.ExtractImages(page)
If IsNothing(images) Or images.Count = 0 Then
    Return Nothing
End If

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

' redact the image in the page
PDFImageHandler.RedactImage(page, images(0), options)
' output file
doc.Save(outputFilePath)