C# TIFF Image Library
Guide for Extracting Page(s) from TIFF File
Simple Solution for TIFF Document Page(s) Extracting in C#.NET
C#.NET TIFF Doc Page(s) Extracting Overview
Sometimes, a Tiff image file is large in size and only a few pages of Tiff document are useful to us, so we need to extract these useful pages from Tiff file. RasterEdge XDoc.Tiff for .NET is designed to help you extract desired page(s) from Tiff document in C# project.
As a professional component, C#.NET Tiff image processing control empowers developers to extract single or multiple pages from a Tiff file, and extract multiple pages from two different Tiff files to form a new Tiff document using C#.NET programming. Furthermore, this control enables C# users to merge or split Tiff documents, add or delete page to or from Tiff file, sort Tiff document pages, and rotate TIFF file page in C#.NET applications.
C#.NET TIFF Doc Page(s) Extracting Demo Code
In this section, we will provide you with a simple C# demo code for extracting three pages from a multi-page Tiff image file.
// Load a Tiff file.
TIFFDocument doc = new TIFFDocument(@"C:\demo1.tif");
if (null == doc)
throw new Exception("Fail to load the file !");
// Define Tiff file pages for extraction.(second, fourth, fifth pages)
int[] extraPageIds = new int[] { 1, 3, 4 };
// Extract selected pages and save to a single Tiff file.
doc.ExtractPages(extraPageIds, @"C:\output.tif");
Related API(s) (TIFFDocument.cs):
public override void ExtractPages(int[] extractIds, string filePath)Description:
Extract a new TIFF file form the source TIFF file,and save it to the given file path.
Parameters:
public override void ExtractPages(int[] extractIds, Stream stream)Description:
Extract a new TIFF file form the source TIFF file,and save it to the given stream
Parameters:
public static void GetOnePageDocument(string sourceFilePath, int index, string destnFilePath)Description:
Extract a specifed page from source TIFF file and use it to create a new TIFF file.
Parameters: