Hello,
I’m trying to convert DGN to PDF and i’m using this code :
Console.WriteLine("starting test");
// load the drawing to be converted
using (var image = Aspose.CAD.Image.Load("C:/Temp/" + "0001--06.dgn"))
{
// create an instance of CadRasterizationOptions & set resultant page size
var rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions()
{
PageSize = new Aspose.CAD.SizeF(1200, 1200),
};
// save resultant PDF
image.Save("C:/Temp/" + "output.pdf", new Aspose.CAD.ImageOptions.PdfOptions() { VectorRasterizationOptions = rasterizationOptions });
}
At the line Aspose.CAD.Image.Load(“C:/Temp/” + “0001–06.dgn”) i got a not implemented exception.
This code is picked from aspose website, so it should works.
Can someone please explain me why it doesn’t work ?
{
using (DgnImage dgnImage = (DgnImage)Image.Load("C:/Temp/test.dgn"))
{
var options = new PdfOptions
{
VectorRasterizationOptions = new CadRasterizationOptions
{
PageWidth = 1500,
PageHeight = 1500,
CenterDrawing = true,
AutomaticLayoutsScaling = true,
BackgroundColor = Color.Black,
Layouts = new string[] { "1", "2", "3", "9" }//only export 4 (1,2,3 and 9) views
}
};
dgnImage.Save("C:/Temp/" + "output.pdf", options);
}
}
}
I got also an error when loading the image:
Aspose.CAD.CadExceptions.ImageLoadException
HResult=0x80131500
Message=Image loading failed.
Source=Aspose.CAD
I have worked with the file shared by you and have been able to observe the issue specified. An issue with ID CADNET-778 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
The issue has just been added in our issue tracking system and is pending in issues queue. We request for your patience till the time the issue gets scheduled and resolved on our end.