DWG to PDF convert gives blank page

Whenever I try to convert a DWG file, I am given a blank PDF. I’ve tried messing with various values, but nothing seems to change


Code from an Aspose example:

using (Aspose.CAD.Image cadImage = Aspose.CAD.Image.Load(Source))
{
// Create an instance of CadRasterizationOptions class
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.PageWidth = 1600;
rasterizationOptions.PageHeight = 1600;

// Set the Entities type property to Entities3D.
rasterizationOptions.TypeOfEntities = TypeOfEntities.Entities3D;

//Despite being in the example listed at https://docs.aspose.com/display/cadnet/Exporting+CAD, this line will not compile
// rasterizationOptions.ScaleMethod = ScaleType.GrowToFit;
rasterizationOptions.ContentAsBitmap = true;

// Set Layouts
rasterizationOptions.Layouts = new string[] { “Model” };

// Create an instance of PDF options class
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.VectorRasterizationOptions = rasterizationOptions;


// Set Graphics options
rasterizationOptions.GraphicsOptions.SmoothingMode = SmoothingMode.HighQuality;
rasterizationOptions.GraphicsOptions.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
rasterizationOptions.GraphicsOptions.InterpolationMode = InterpolationMode.HighQualityBicubic;

// Export to PDF by calling the Save method
cadImage.Save(Destination, pdfOptions);
}

Got it outputting, but now there’s an extra page being generated and the fonts are messed up:


CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.PageWidth = 1920;
rasterizationOptions.PageHeight = 1080;

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:\Users\agarcia\Source\Repos\Factory Logistics\XPSWatchdog\Destination\Cutting Sheets\test.pdf”, pdfOptions);

@Adrianjamesgarcia1,

I have worked with DWG file shared by you and have been able to observe multiple pages in exported PDF. An issue with ID CADNET-355 has been created in our issue tracking system to further investigate and resolve the issue. I have also observed font rendering issues in exported PDF as well and a separate issue with ID CADNET-356 has been created in our issue tracking to resolve the issue. This thread has been linked with the issues so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

Mudassir Fayyaz

The issues you have found earlier (filed as CADNET-355) have been fixed in Aspose.CAD for .NET 17.12. Please try using the latest release version and in case you experience any issue or you have any further query, please feel free to contact.

The issues you have found earlier (filed as CADNET-356) have been fixed in Aspose.CAD for .NET 17.12. Please try using the latest release version and in case you experience any issue or you have any further query, please feel free to contact.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.