Manipulating CorelDRAW Files

Contents
[ ]

Load a CDR File

Aspose.Imaging now supports the CDR files. A CDR file is a drawing created with CorelDRAW, a vector illustration and page layout program. In the example below, an existing CDR file is loaded by passing the file path to the Image class static Load method.

The following code snippet shows you how to load a CDR file.

using Aspose.Imaging;
using Aspose.Imaging.FileFormats.Bmp;
using Aspose.Imaging.FileFormats.Eps;
using Aspose.Imaging.FileFormats.Eps.Consts;
using Aspose.Imaging.FileFormats.Png;
using Aspose.Imaging.FileFormats.Psd;
using Aspose.Imaging.FileFormats.Svg;
using Aspose.Imaging.ImageOptions;
using Aspose.Imaging.Sources;
using System;
using System.IO;
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
string dataDir = templatesFolder;
string inputFileName = dataDir + "template.cdr";
FileFormat expectedFileFormat = FileFormat.Cdr;
using (Image image = Image.Load(inputFileName))
{
if (expectedFileFormat != image.FileFormat)
{
throw new Exception("Image FileFormat is not {expectedFileFormat}");
}
}