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:
asp.net azure pdf editor control: ASP.NET Azure PDF Editor Control: view, edit, annotate, redact PDF files online
asp.net image file viewer: ASP.NET Image Document Viewer Control: view, annotate, redact, convert image files in html web browser
asp.net azure file viewer: ASP.NET Azure Document Viewer: view, annotate files online using ASP.NET Cloud Service
asp.net powerpoint file viewer: ASP.NET PowerPoint Document Viewer Control: view pptx files online in C# using ASP.NET
asp.net edit pdf text control: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
file redact asp.net: Redact document ASP.NET: add, delete, apply redaction on PDF files in web browser using C#.net
asp.net annotate pdf control: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET 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: