When I convert DWG file to a pdf using Aspose.CAD.Image with different options, line colors convert fine, but the next color if very bleak. Take a look at the screen shot.test.pdf (505.0 KB).
Here is the code that I use:
string MyDir = @“C:\Temp”;
string sourceFilePath = MyDir + “test.dwg”;
string targetFilePath = MyDir + “test.pdf”;
using (Aspose.CAD.Image cadImage = Image.Load(sourceFilePath, new LoadOptions { UnloadOnDispose = true }))
{
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions
{
PageWidth = 1600,
PageHeight = 1600,
DrawType = Aspose.CAD.FileFormats.Cad.CadDrawTypeMode.UseObjectColor,
};
if (System.IO.File.Exists(targetFilePath))
System.IO.File.Delete(targetFilePath);
cadImage.Save(targetFilePath, new PdfOptions { VectorRasterizationOptions = rasterizationOptions });
}