//// This code is part of Document Solutions for PDF .NET demos.// Copyright (c) MESCIUS inc. All rights reserved.//usingSystem.IO;usingSystem.Drawing;usingGrapeCity.Documents.Pdf;usingGrapeCity.Documents.Pdf.Annotations; namespaceDsPdfWeb.Demos{// 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.publicclassRedactArea {publicintCreatePDF(Stream stream) {var doc = newGcPdfDocument();usingvar fs = File.OpenRead(Path.Combine("Resources", "PDFs", "SlidePages.pdf"));// Load the PDF containing redact annotations (areas marked for redaction): doc.Load(fs); var redact = newRedactAnnotation() {Rect = newRectangleF(16, 16, 280, 300),Page = doc.Pages[0],OverlayText = "This content has been redacted.",OverlayFillColor = Color.PaleGoldenrod }; // Apply the redact: doc.Redact(redact); // Done: doc.Save(stream);return doc.Pages.Count; } }}