XDoc.PDF
Features
Tech Specs
How-to C#
How-to VB.NET
Pricing
C# PDF: How to PDF Create PDF Export File and Page Process PDF Read PDF Write Form Process Document Protect Annotation & Drawing PDF Print WPF Viewer & Editor Work with Other SDKs Barcode Read Barcode Create OCR Twain
Image: Remove Image from PDF Page
  |  
Home ›› XDoc.PDF ›› C# PDF: Remove Image from PDF Page

C#.NET PDF SDK - Remove Image from PDF Page in C#.NET


.NET PDF SDK Provides C# Demo Code for Deleting and Removing Image from PDF File Page




A best C#.NET PDF image editor control able to delete images from adobe PDF document in Visual Studio .NET framework project


Free evaluation SDK library for PDF image deletion in .NET WinForms and ASP.NET program


Support .NET WinForms, ASP.NET MVC in IIS, ASP.NET Ajax, Azure cloud service, DNN (DotNetNuke), SharePoint


C#.NET class source code are accessible for removing PDF pages in .NET console application


Support removing vector image, graphic picture, digital photo, scanned signature, logo, etc


Get all image objects and remove multiple or all images from PDF document


Delete and remove all image objects contained in a specific PDF page


Define position to remove a specified image from PDF document page


RasterEdge XDoc.PDF for .NET provides C# developers with various methods to obtain and delete image objects included in Adobe PDF document. Generally speaking, using well-designed APIs, C# developers can do following things.




C#.NET Demo Code: Remove Image from PDF Page Using C#.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.XImage.Raster.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XDoc.PDF.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.PDF;


Note: When you get the error "Could not load file or assembly 'RasterEdge.Imaging.Basic' or any other assembly or one of its dependencies. An attempt to load a program with an incorrect format", please check your configure as follows:

       

       If you are using x64 libraries/dlls, Right click the project -> Properties -> Build -> Platform target: x64.

       

       If using x86, the platform target should be x86.


This complete C# example shows how to extract all images and delete them all from PDF document.




String inputFilePath = Program.RootPath + "\\" + "3.pdf";
String outputFilePath = Program.RootPath + "\\" + "output.pdf";

// Open a PDF document.
PDFDocument doc = new PDFDocument(inputFilePath);

// Extract all images from the document.
List<PDFImage> allImages = PDFImageHandler.ExtractImages(doc);

// Delete all images from the document.
foreach (PDFImage image in allImages)
{
    PDFImageHandler.DeleteImage(doc, image);
}

// Output the new PDF document.
doc.Save(outputFilePath);





public static int DeleteImage(PDFDocument doc, PDFImage image)

Description:
     Delete the specified image from PDF file.

Parameters:

Return:
     Error code, 0 if success.