We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to PDF a DGN in color?

I have the rasterizations to use the draw color, but the PDF is all monochrome.

please, attach your code and file too, so we can look at it.

Here you go. This will result in a monochrome PDF.


        ' 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
        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

probably, the initial file is monochrome too? We can not analyze and debug why color is missing without the initial file. Please, attach it.