Convert cmx to tiff

Contents
[ ]

Using Aspose.Imaging we can convert single paged or multi-page cmx image to single or multi-page tiff.

The following code snippet shows you how to convert cmx to tiff.

using Aspose.Imaging;
using Aspose.Imaging.FileFormats.Tiff.Enums;
using Aspose.Imaging.ImageOptions;
using System;
using System.IO;
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
string dataDir = templatesFolder;
using (var image = (VectorMultipageImage)Image.Load(dataDir + "template.cmx"))
{
VectorRasterizationOptions[] pageOptions = new VectorRasterizationOptions[image.Pages.Length];
for (int i = 0; i < image.Pages.Length; i++)
{
CmxRasterizationOptions option = new CmxRasterizationOptions();
option.PageSize = image.Pages[i].Size;
pageOptions[i] = option;
}
// Create TIFF options
var options = new TiffOptions(TiffExpectedFormat.TiffDeflateRgb) { MultiPageOptions = new MultiPageOptions { PageRasterizationOptions = pageOptions } };
// Export image to TIFF format
image.Save(dataDir + "result.tiff", options);
}
File.Delete(dataDir + "result.tiff");