Hello,
I started my evaluation of Aspose.CAD and my main use case is converting DWF files to PDF. I tried to convert several DWF files from our engineering department and none of them have worked; I keep getting an exception.
Here is my sample code, using C# 7.2 and Aspose.CAD 18.3
var inputFilePath = @"C:\drawing.dwf";
using (var cadImage = Image.Load(inputFilePath))
{
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.PageWidth = cadImage.Width;
rasterizationOptions.PageHeight = cadImage.Height;
rasterizationOptions.TypeOfEntities = TypeOfEntities.Entities2D;
rasterizationOptions.AutomaticLayoutsScaling = true;
rasterizationOptions.NoScaling = false;
rasterizationOptions.ContentAsBitmap = true;
rasterizationOptions.Layouts = new string[] { "Model" };
rasterizationOptions.GraphicsOptions.SmoothingMode = SmoothingMode.HighQuality;
rasterizationOptions.GraphicsOptions.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
rasterizationOptions.GraphicsOptions.InterpolationMode = InterpolationMode.HighQualityBicubic;
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.VectorRasterizationOptions = rasterizationOptions;
cadImage.Save(@"C:\drawing.pdf", pdfOptions);
}
I’m getting an exception when executing var cadImage = Image.Load(inputFilePath)
Here is drawing.dwf :
drawing.zip (9.1 MB)
Thank you for your help!