I am using the code below to merge multiple single page TIFF files together, a copy the single page TIFF files into a folder, run the routine below to merge, then proceed to the next batch, delete the prior files copied, then copy the next batch of files to be merged, etc. However, after one or 2 cycles, the delete fails as it indicates the files are still in use, I assume by the imaging routine
Any suggestions?
*** START CODE ***
Aspose.Imaging.FileFormats.Tiff.TiffImage imgAddition = null;
Aspose.Imaging.FileFormats.Tiff.TiffFrame ifrAddition = null;
Aspose.Imaging.FileFormats.Tiff.TiffImage imgOriginal = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(mPath + "\\" + Path.GetFileName((string)aSourceFiles[1]));
for (int i = 2; i <= aSourceFiles.Count; i++)
{
imgAddition = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(mPath + "\\" + Path.GetFileName((string)aSourceFiles[i]));
ifrAddition = Aspose.Imaging.FileFormats.Tiff.TiffFrame.CopyFrame(imgAddition.ActiveFrame);
imgOriginal.AddFrame(ifrAddition);
}
imgOriginal.Save(mPath + "\\merged.tif");
imgOriginal.Dispose();
*** END CODE ***