ByteScout Data Extraction Suite - C# - Extract Images by Page from PDF with PDF Extractor SDK - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Data Extraction Suite – C# – Extract Images by Page from PDF with PDF Extractor SDK

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

How to extract images by page from PDF with PDF extractor SDK in C# using ByteScout Data Extraction Suite

Learn to code in C# to extract images by page from PDF with PDF extractor SDK with this step-by-step tutorial

The sample source codes on this page shows how to extract images by page from PDF with PDF extractor SDK in C#. ByteScout Data Extraction Suite is the bundle that includes three SDK tools for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK and you can use it to extract images by page from PDF with PDF extractor SDK with C#.

The following code snippet for ByteScout Data Extraction Suite works best when you need to quickly extract images by page from PDF with PDF extractor SDK in your C# application. 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! Complete and detailed tutorials and documentation are available along with installed ByteScout Data Extraction Suite if you’d like to learn more about the topic and the details of the API.

ByteScout Data Extraction Suite free trial version is available on our website. C# and other programming languages are supported.

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 Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite 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 Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next