How to C#: Tiff
Using Tiff SDK for C#.NET
Merge and Append Tiff Files
Merge and Append Tiff Files
  |  
Home ›› XDoc.Tiff ›› C# Tiff: Merge and Append Tiff

C# TIFF - Merge TIFF File in C#.NET


How to Merge and Append TIFF Files in C# by Using RasterEdge XDoc.Tiff for .NET SDK




Merge and Append TIFF Files in C#.NET Overview



RasterEdge .NET Tiff processing SDK (XDoc.Tiff for .NET) provides C# developers and end-users with proven and reliable solutions for merging and appending Tiff files. Tiff files merging and appending capabilities can be integrated with your document management system. With RasterEdge image saving and printing support, users are able to save the new Tiff document efficiently and accurately.


Related .net document control helps:
c# asp.net mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects
c# asp.net text file viewer: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET
c# asp.net tiff viewer: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control
c# asp.net pdf editor: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net mvc excel viewer: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
c# asp.net word document viewer: ASP.NET Office Word Document Viewer: view Word doc files online using C# in ASP.NET MVC web applications
asp.net edit pdf page using c#: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#


Except for Tiff document merging and appending functions, RasterEdge .NET Tiff processing DLL can also be combined with users C#.NET applications to do Tiff file or page(s) rotating, reordering, splitting, deleting, etc, specific tutorials for main functions are listed below.


Mature solution in C# to add new blank Tiff page


Mature solution in C# to rotate Tiff page


Mature solution in C# to remove and delete Tiff page


Mature solution in C# to reorder Tiff pages


Mature solution in C# to split Tiff file




C# Project DLLs: Merge TIFF File



In order to run the following conversion code, please do as follows:


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.




Merge Two Tiff Image Files in C# Project



You can load two Tiff images, merge them, and create a new Tiff image file.




// Define Tiff image files.
            string[] tifFiles = new string[] { @"C:\demo1.tif", @"C:\demo2.tif" };

            // Merge these Tiff files to a single Tiff file and save it to output.tif. 
            TIFFDocument.CombineDocument(tifFiles, @"C:\output.tif");





Append Two Tiff Image Files in C# Project



In addition to Tiff file merging, you can also append one Tiff image to the end of another one. For instance, this example shows how to append demo2.tif to the end of demo1.tif.




// Load Tiff image files.
            TIFFDocument doc1 = new TIFFDocument(@"C:\demo1.tif");
            TIFFDocument doc2 = new TIFFDocument(@"C:\demo2.tif");
            if (null == doc1 || null == doc2)
                throw new Exception("Fail to load TIFF Document, pls check file path or others.");

            // Append demo2.tif to the end of demo1.tif.
            doc1.AppendDocument(doc2);
            doc1.Save(@"C:\append.tif");



public static void CombineDocument(Stream[] sourceFiles, string outFile)

Description:
Combine multiple TIFF files into one, and save it to the specified file path.

Parameters:
public static void CombineDocument(string[] sourceFiles, Stream stream)

Description:
Combine multiple TIFF files into one, and save it to the specified stream

Parameters:
public static void CombineDocument(Stream[] sourceFiles, Stream stream)

Description:
Combine multiple TIFF files into one, and save it to the specified stream

Parameters:
public static void CombineDocument(string[] sourceFiles, string destn)

Description:
Combine multiple TIFF files into one, and save it to the specified file path

Parameters:
public override int AppendDocument(BaseDocument appendDoc)

Description:
Append new TIFF file to the original one.

Parameters: