ByteScout PDF Extractor SDK - C# - Extract Images by Page from PDF - ByteScout

ByteScout PDF Extractor SDK – C# – Extract Images by Page from PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – C# – Extract Images by Page from PDF

How to extract images by page from PDF in C# and ByteScout PDF Extractor SDK

The tutorial shows how to extract images by page from PDF in C#

The sample shows steps and algorithm of how to extract images by page from PDF and how to make it work in your C# application. ByteScout PDF Extractor SDK is the Software Development Kit (SDK) that is designed to help developers with data extraction from unstructured documents like pdf, tiff, scans, images, scanned and electronic forms. The library is powered by OCR, computer vision and AI to provide unique functionality like table detection, automatic table structure extraction, data restoration, data restructuring and reconstruction. Supports PDF, TIFF, PNG, JPG images as input and can output CSV, XML, JSON formatted data. Includes full set of utilities like pdf splitter, pdf merger, searchable pdf maker. It can be used to extract images by page from PDF using C#.

This rich sample source code in C# for ByteScout PDF Extractor SDK includes the number of functions and options you should do calling the API to extract images by page from PDF. This C# sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Code testing will allow the function to be tested and work properly with your data.

ByteScout free trial version is available for download from our website. It includes all these programming tutorials along with source code samples.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using System; using System.Drawing.Imaging; using Bytescout.PDFExtractor; using System.Diagnostics; namespace ExtractImagesByPages { class Program { static void Main(string[] args) { // Create Bytescout.PDFExtractor.ImageExtractor instance ImageExtractor extractor = new ImageExtractor(); extractor.RegistrationName = "demo"; extractor.RegistrationKey = "demo"; // Load sample PDF document extractor.LoadDocumentFromFile(@".\sample1.pdf"); // Get count of pages int pageCount = extractor.GetPageCount(); // Extract images from each page for (int i = 0; i < pageCount; i++) { int j = 0; // Initialize page images enumeration if (extractor.GetFirstPageImage(i)) { do { string outputFileName = "page" + i + "image" + j + ".png"; // Save image to file extractor.SaveCurrentImageToFile(outputFileName, ImageFormat.Png); j++; } while (extractor.GetNextImage()); // Advance image enumeration } } // Cleanup extractor.Dispose(); // Open first output file in default associated application ProcessStartInfo processStartInfo = new ProcessStartInfo("page0image0.png"); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Extractor SDK Home Page

Explore ByteScout PDF Extractor SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Extractor SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Extractor SDK Home Page

Explore ByteScout PDF Extractor SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Extractor SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next