Free Support Forum - aspose.com

DWG file to PDF conversion

I am using the latest Aspose.CAD v20.11.0 library to convert a dwg file to pdf. For the most part, all conversions are completed without any problems, but some of the converted files are missing content.

A sample input file is attached and the code included shows the rasterization options used for conversion:

using var image = Aspose.CAD.Image.Load(sourceStream);

var rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();

if (image.Height >= image.Width)
{
//Portrait
rasterizationOptions.PageWidth = Aspose.Pdf.PageSize.PageLetter.Width;
rasterizationOptions.PageHeight = Aspose.Pdf.PageSize.PageLetter.Height;
}
else
{
//Landscape
rasterizationOptions.PageWidth = Aspose.Pdf.PageSize.PageLetter.Height;
rasterizationOptions.PageHeight = Aspose.Pdf.PageSize.PageLetter.Width;
}

rasterizationOptions.AutomaticLayoutsScaling = true;
rasterizationOptions.NoScaling = false;
var pointsPerInch = 72;
var margin = pointsPerInch / 2;
rasterizationOptions.Margins = new Aspose.CAD.ImageOptions.Margins() { Top = margin, Bottom = margin, Left = margin, Right = margin };

var pdfOptions = new Aspose.CAD.ImageOptions.PdfOptions();

pdfOptions.VectorRasterizationOptions = rasterizationOptions;

image.Save(pdfFilePath, pdfOptions);

The result file is missing some content and I am unsure why. I have tried updating the RasterizationQuality and GraphicsOptions, but nothing produces the missing content. Also, this happens on a majority of the dwg file inputs.input_file.zip (41.9 KB)

@IRISNDT

I have created an issue with ID CADNET-1307 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 issues you have found earlier (filed as CADNET-1307) have been fixed in this update.