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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Janat AlJamalPosted Dec 17, 2019, 11:25 AM
{
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);
paul danielPosted Mar 15, 2010, 7:23 AM
http://kseesharp.blogspot.com/2007/12/class-for-tiff-manipulation.html
http://forums.asp.net/t/1447100.aspx