XDoc.PDF
Features
Tech Specs
How-to VB.NET
Pricing
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

VB.NET PDF - Redact Entire PDF Pages in VB.NET


Enable VB.NET Users to Redact PDF Pages to Protect PDF Document in VB.NET Project





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



If you need to permanently removing visible text and graphics from a document. Please try the following VB.NET code, which supports VB.NET users to call our redact function API and redact entire PDF pages. In addition, you can specify custom text to appear over the redaction area.




Redact PDF Whole Pages Using VB.NET



Add necessary references:


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Raster.dll


  RasterEdge.XDoc.Raster.Core.dll


  RasterEdge.XDoc.PDF.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.PDF;


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




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 1st page
Dim page As PDFPage = doc.GetPage(0)

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

' redact the whole page
page.Redact(options)
' output file
doc.Save(outputFilePath)