'''' This code is part of Document Solutions for PDF .NET demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystem.IOImportsSystem.DrawingImportsGrapeCity.Documents.PdfImportsGrapeCity.Documents.Pdf.Annotations '' This sample demonstrates the use of GcPdfDocument.Redact() method.'' It loads the PDF generated by the SlidePages sample, creates'' a redact annotation on the first page, and applies it.PublicClassRedactAreaFunctionCreatePDF(ByVal stream AsStream) AsIntegerDim doc = NewGcPdfDocument()Using fs = NewFileStream(Path.Combine("Resources", "PDFs", "SlidePages.pdf"), FileMode.Open, FileAccess.Read)'' Load the PDF containing redact annotations (areas marked for redaction): doc.Load(fs) Dim rc = NewRectangleF(16, 16, 280, 300) Dim redact = NewRedactAnnotation() With { .Rect = rc, .Page = doc.Pages(0), .OverlayText = "This content has been redacted.", .OverlayFillColor = Color.PaleGoldenrod } '' Apply the redact doc.Redact(redact) '' doc.Pages(0).Graphics.DrawRectangle(rc, Color.Red) '' Done doc.Save(stream)Return doc.Pages.CountEndUsingEndFunctionEndClass