PDF Toolkit

Samples

Extract images from PDF

Extract all images from a PDF document

Note that the images extracted from the PDF file will be saved in the same format that they were added to the PDF.

This Code sample requires the PDF Toolkit and is found in: C:\Aquaforest\PDF Toolkit\samples\ExtractImagesFromPDF


using Aquaforest.PDF;
 
namespace ExtractImagesFromPDF
{
    class Program
    {
        static void Main(string[] args)
        {
            PDFDocument doc = new PDFDocument(@"..\..\..\documents\source\pdf_with_images.pdf");
            PDFImageExtractor extractor = new PDFImageExtractor(doc);
            extractor.ExtractImages(@"..\..\..\documents\output", "img", false);
        }
    }
}