I have the rasterizations to use the draw color, but the PDF is all monochrome.
VB.net
Here you go. This will result in a monochrome PDF.
Try
' Load an existing DGN file as CadImage.
Using cadImage As Aspose.CAD.FileFormats.Dgn.DgnImage = CType(Aspose.CAD.FileFormats.Dgn.DgnImage.Load(sourceFilePath), Aspose.CAD.FileFormats.Dgn.DgnImage)
' Create an object of CadRasterizationOptions class and define/set different properties
Dim rasterizationOptions As New Aspose.CAD.ImageOptions.CadRasterizationOptions()
rasterizationOptions.PageWidth = 600
rasterizationOptions.PageHeight = 300
rasterizationOptions.NoScaling = True
rasterizationOptions.AutomaticLayoutsScaling = False
rasterizationOptions.DrawType = Aspose.CAD.FileFormats.Cad.CadDrawTypeMode.UseDrawColor
' Create an object of PdfOptions class as we are converting the image to PDF format and assign CadRasterizationOptions object to it.
Dim pdfOptions As New Aspose.CAD.ImageOptions.PdfOptions()
pdfOptions.VectorRasterizationOptions = rasterizationOptions
' Call the save method of the CadImage class object.
cadImage.Save(DestFilePath, pdfOptions)
End Using
'ExEnd:ExportDGNToPdf
Console.WriteLine(vbLf & "The DGN file exported successfully to PDF." & vbLf & "File saved at " & DestFilePath)
Catch ex As Exception
Console.WriteLine("Please use valid input file." & ex.Message)
End Try
@AroundLilac,
probably, the initial file is monochrome too? We can not analyze and debug why color is missing without the initial file. Please, attach it.