Guide for C#
Core Document Formats
Additional Features

C# TIFF - Split Multi-page TIFF File in C#.NET

C# Code on How to Use TIFF Processing DLL to Split Multi-page TIFF File

Visual C#
Home > .NET Imaging SDK > C# > Split TIFF
If this is your first time to use our DocImageSDK, we strongly suggest you reading How to Start first!

C# Image: Split Multi-page TIFF File Overview
RasterEdge .NET TIFF Processing toolkit of RasterEdge .NET Imaging SDK supplies the robust and reliable TIFF file pages splitting solutions to users to divide any target TIFF pages or create your customized TIFF splitting application in C#.NET class library. RasterEdge .NET TIFF DLL also allows users to pre-process TIFF document like TIFF file loading and decoding. Besides, split TIFF files saving and printing are also available based on the TIFF processing technology.
Layout of C# TIFF splitting tutorial article:
  • C# TIFF pages splitting features by using Rasteredge .NET TIFF Processing DLL
  • How to split multi-page TIFF document within C# Windows application
  • More detailed multi-page TIFF functions tutorials in other .NET libraries
C# Project Multi-page TIFF File Splitting Features
  • Supported by RasterEdge .NET TIFF Processing DLL control
  • Support TIFF image pre-processing functions, like TIFF file loading and TIFF document decoding in C#
  • Flexible TIFF document page splitting method in C# class
  • Easy to adjust the splitting page number within C# sample code
  • Support high-speed TIFF document splitting and saving capabilities in your Visual C# program
  • Store split TIFF files to disk or memory as you wish
How to Split Multi-page TIFF in C# Project
With TIFF splitting solution of RasterEdge DocImage SDK for .NET, developers are capable of splitting multi-page TIFF file into two or more single or multi-page TIFF documents by using C# code. Please follow steps below to get detailed instruction.

How to create C# Windows Projects

This part is aimed at providing users the detailed guide on how to create the compliant C# Windows application for splitting TIFF document by using RasterEdge .NET TIFF Processing SDK.
  1. Open Microsoft Visual Studio 2005, 2008 or 2010 version;
  2. Create a Windows project with C# programming language;
  3. Activate C#.NET Imaging SDK license;
  4. Copy your RasterEdge license text to "Debug" folder under the "bin" file of the created C# Windows project;
  5. Add RasterEdge .NET Imaging libraries to your Visual C# applications;
    • RasterEdge.Imaging.Basic.dll
    • RasterEdge.Imaging.TIFF.dll
  6. Define following using statements of RasterEdge .NET Imaging SDK:
using RasterEdge.Imaging.TIFF;
using RasterEdge.Imaging.Basic.Core;
using RasterEdge.Imaging.Basic;

Split Multi-page TIFF File - Method in C#

Following method list is for splitting TIFF document in C# class by using RasterEdge .NET Imaging control library. As you can see, before you can split target TIFF file, you are supposed to use RasterEdge "OpenDocumentFile" method to decode TIFF document and then use "SplitDocument" API to divide TIFF file pages.
public static REDocument OpenDocumentFile(string filePath);
public static REDocument OpenDocumentFile(string filePath, BaseDecoder dec);
public abstract List<BaseDocument> SplitDocument(int pageIndex);

C# Code to Split Multi-page TIFF File

Following C# sample code demonstrates how to split multi-page TIFF file using above method. Also, users can program your own customized TIFF file splitting function by changing following demo code, like adjusting the page number.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using RasterEdge.Imaging.TIFF;
using RasterEdge.Imaging.Basic.Core;
using RasterEdge.Imaging.Basic;

namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public static string FolderName = "c:/";

private void button1_Click(object sender, EventArgs e)
{
string fileName = FolderName + "Sample.tif";

REDocument doc = REFile.OpenDocumentFile(fileName, new TIFDecoder());//use TIFDecoder open a pdf file

List<BaseDocument> baseDocs = doc.SplitDocument(1);

int index = 0;

foreach (BaseDocument baseDoc in baseDocs)
{
// REImage reimage = (REImage)baseDoc.GetPage(0).ToImage();
index++;

REFile.SaveDocumentFile((REDocument)baseDoc, "c:/reDoc" + index + ".tif", new TIFEncoder());
}
}
}
}
More Multi-page TIFF Functions Tutorials in .NET Projects
RasterEdge .NET TIFF Processing toolkit can be seamlessly combined within a broad range of Visual .NET projects, such as C#.NET, VB.NET, web ASP.NET and .NET Windows Forms. Following link list shows the most TIFF processing functions by using .NET TIFF processing components in supported Visual .NET applications, please link respectively to get each detail guide.


Recommend this to Google+