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:
c# asp.net mvc document viewer: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer...
asp.net view powerpoint: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
asp.net document viewer example: EdgeDoc:ASP.NET Document Viewer C# Control: Open, view, annotate, redact, convert documents online in C#, VB.NET, AS...
asp.net pdf document viewer c#: ASP.NET PDF Document Viewer in C#: open, display, view, annotate, redact Adobe PDF files online in ASP.NET MVC & WebForm...
c# asp.net mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects
asp.net view text file in browser: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET
asp.net mvc word viewer: ASP.NET Office Word Document Viewer: view Word doc files online using C# in ASP.NET MVC web applications


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: