Trying to convert dwg to pdf, result is document splitted in 2 pdf pages. Is a problem for me.
ASPOSE.CAD for .NET
SDK version: 19.5.0
The code:
string MyDir = @“C:\Users\rcatasta\Documents\cad”;
string sourceFilePath = MyDir + “CAD8.dwg”;
using (Aspose.CAD.Image image = Aspose.CAD.Image.Load(sourceFilePath))
{
// Create an instance of CadRasterizationOptions and set its various properties
Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
rasterizationOptions.BackgroundColor = Aspose.CAD.Color.White;
rasterizationOptions.NoScaling = false;
rasterizationOptions.PageWidth = 1600;
rasterizationOptions.PageHeight = 1600;
rasterizationOptions.ContentAsBitmap = false;
//DrawColor = Aspose.CAD.Color.Black,
//DrawType = Aspose.CAD.FileFormats.Cad.CadDrawTypeMode.UseDrawColor,
// rasterizationOptions.AutomaticLayoutsScaling = true;
// Create an instance of PdfOptions
Aspose.CAD.ImageOptions.PdfOptions pdfOptions = new Aspose.CAD.ImageOptions.PdfOptions();
// Set the VectorRasterizationOptions property
pdfOptions.VectorRasterizationOptions = rasterizationOptions;
MyDir = MyDir + "convertito8.pdf";
//Export the DWG to PDF
image.Save(MyDir, pdfOptions);
}
//ExEnd:ExportToPDF