Hi,
I have two Tiff files, i need to merge them bot. How can we do that using .net? and I need to merger file1 and the all pages in file2 excluding the first page.
Thanks in advance.
Thanks,
Shalem
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
paul daniel189 reputationPosted Mar 15, 2010, 3:23 AM EDT
http://kseesharp.blogspot.com/2007/12/class-for-tiff-manipulation.html
http://forums.asp.net/t/1447100.aspx
Janat AlJamal114 reputationPosted Dec 17, 2019, 6:25 AM EST
{
using RasterCodecs codecs = new RasterCodecs();
RasterImage image = null;
try
{
foreach (var mergeFile in mergeFiles)
{
if (image == null)
image = codecs.Load(mergeFile.FileName, 0, CodecsLoadByteOrder.BgrOrGray, mergeFile.FirstPage, mergeFile.LastPage);
else
image.AddPages(codecs.Load(mergeFile.FileName, 0, CodecsLoadByteOrder.BgrOrGray, mergeFile.FirstPage, mergeFile.LastPage), mergeFile.FirstPage, mergeFile.LastPage);
}
codecs.Save(image, outputFile, outputFormat, 0);
}
finally
{
image.Dispose();
}
}
MergeFile mergeFile1 = new MergeFile
{
FileName = @"C:\Users\Public\Documents\LEADTOOLS Images\ocr1-4.tif",
FirstPage = 1,
LastPage = -1
};
MergeFile mergeFile2 = new MergeFile
{
FileName = @"C:\Users\Public\Documents\LEADTOOLS Images\ocr1-4.tif",
FirstPage = 1,
LastPage = -1
};
Merge(new MergeFile[] { mergeFile1, mergeFile2 }, @"C:\Temp\out.tif", RasterImageFormat);