How to C#: Tiff
Using Tiff SDK for C#.NET
Extract Tiff Pages
Extract Tiff Pages
  |  
Home ›› XDoc.Tiff ›› C# Tiff: Extract Tiff Page

C# TIFF - 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.


Related .net document control helps:
asp.net pdf editor: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net sharepoint pdf editor: ASP.NET SharePoint PDF Editor Control: view, edit, annotate, redact PDF document in SharePoint sites
asp.net iis document viewer: C# HTML5 Viewer: Deployment on IIS
asp.net powerpoint document viewer: ASP.NET PowerPoint Document Viewer Control: view pptx files online in C# using ASP.NET
asp.net pdf file permission: ASP.NET PDF File Permission Control: apply, remove PDF file permission settings in C#
asp.net pdf editor: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net sharepoint pdf editor: ASP.NET SharePoint PDF Editor Control: view, edit, annotate, redact PDF document in SharePoint sites


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



Add references;


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.XDoc.Processing.dll


  RasterEdge.Imaging.Raster.dll


  RasterEdge.Imaging.Raster.Core.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.XDoc.TIFF.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.TIFF;


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.


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"); 



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: