C# PDF Viewer Control Library
How to open, display, redact PDF file, page images using c# in browser, winforms. Free Download
How to Redact PDF Images to Protect Your PDF Document in C# Using .NET PDF SDK
- Best .NET PDF document manipulation SDK library for PDF image information protecting in C#.NET framework program
- Support .NET WinForms, ASP.NET MVC in IIS, ASP.NET Ajax, Azure cloud service, DNN (DotNetNuke), SharePoint
- Free trial components package for erasing PDF image in C#.NET WinForms and ASP.NET Web project
- Free C# source code for quick evaluation in C#.NET class to darken selected image on adobe PDF document
- A professional .NET control allows users to black out image in PDF document in Visual Studio C#.NET application
- Enable users abilities to adjust color and transparency while scraping image from PDF file
- Able to redact selected PDF image or all images in whole PDF file
You can quickly redact PDF images to protect confidential information inside the images. You can call our image redaction API to redact PDF images. Same as text redaction, you can specify custom text to appear over the image redaction area.
Redact an image in the page using c#
String inputFilePath = Program.RootPath + "\\" + "2.pdf";
String outputFilePath = Program.RootPath + "\\" + "output.pdf";
// open document
PDFDocument doc = new PDFDocument(inputFilePath);
// get the 1st page
PDFPage page = (PDFPage)doc.GetPage(0);
List<PDFImage> images = PDFImageHandler.ExtractImages(page);
if (images == null || images.Count == 0) return;
// create redaction option
RedactionOptions options = new RedactionOptions();
options.AreaFillColor = Color.LightGray;
// redact the image in the page
PDFImageHandler.RedactImage(page, images[0], options);
// output file
doc.Save(outputFilePath);
Redact contents in the given area of a page using c#
String inputFilePath = Program.RootPath + "\\" + "1.pdf";
String outputFilePath = Program.RootPath + "\\" + "output.pdf";
// open file and get the first page
PDFDocument doc = new PDFDocument(inputFilePath);
int pageIndex = 0;
PDFPage page = (PDFPage)doc.GetPage(pageIndex);
// set a redact area start from point (200, 300) with size (200, 150)
// all value in pixels (96 dpi)
RectangleF redactArea = new RectangleF(200, 300, 200, 150);
// use default redact options
RedactionOptions ops = new RedactionOptions();
// apply redaction for the whole page
page.Redact(redactArea, ops);
doc.Save(outputFilePath);