Hi,
We are using Aspose.CAD version 19.2 and the following code to convert DWG, DWT and DXF to PDF:
private void DwgDwtDxfToPdf(Stream input, Stream output)
{
using (var cadImage = (CadImage) Image.Load(input))
{
var has3DObjects =
cadImage.Entities.Any(cadEntity =>
cadEntity.TypeName == CadEntityTypeName.FACE3D
|| cadEntity.TypeName == CadEntityTypeName.SOLID3D);
var cadPageSizes = CadPageSizesForA4(cadImage.UnitType);
var rasterizationOptions = new CadRasterizationOptions
{
TypeOfEntities =
has3DObjects
? TypeOfEntities.Entities3D
: TypeOfEntities.Entities2D,
PageWidth = cadPageSizes.PageWidth,
PageHeight = cadPageSizes.PageHeight,
UnitType = cadPageSizes.UnitType,
DrawType = CadDrawTypeMode.UseObjectColor,
CenterDrawing = true
};
cadImage.Save(output, new PdfOptions
{
VectorRasterizationOptions = rasterizationOptions
});
}
}
We switched to 19.5 that supports .NET Standard but the code will no longer build and throws:
CadRasterizationOptions’ does not contain a definition for ‘TypeOfEntities’
Can you please guide us in porting the code to 19.5?
Thank you!