VB.NET PDF: How to HTML5 PDF Viewer PDF Create PDF Export File & Page Process PDF Read PDF Write Form Process Document Protect Annotation & Drawing PDF Print WPF PDF Viewer Work with Other SDKs Barcode Read Barcode Create OCR Twain
Redact Pages
  |  
Home ›› XDoc.PDF ›› VB.NET PDF: Redact Pages

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




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)