//// This code is part of Document Solutions for PDF .NET demos.// Copyright (c) MESCIUS inc. All rights reserved.//usingSystem.IO;usingGrapeCity.Documents.Pdf; namespaceDsPdfWeb.Demos{// This sample demonstrates the use of GcPdfDocument.Redact() method. // It loads the PDF generated by the FindAndRedact sample, in which// certain areas are marked for redaction, and applies those redacts. // The original PDF without redact annotations is created by TimeSheet.publicclassApplyRedact {publicintCreatePDF(Stream stream) {var doc = newGcPdfDocument();usingvar fs = File.OpenRead(Path.Combine("Resources", "PDFs", "find-and-redact.pdf"));// Load the PDF containing redact annotations (areas marked for redaction): doc.Load(fs); // Apply the redacts: doc.Redact(); // Done: doc.Save(stream);return doc.Pages.Count; } }}