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

Free Support Forum - aspose.com

Unable to convert DWG files to PDF

Hi!

I started evaluation of Aspose.CAD today, but I see, that it cannot process several DWG files from my collection correctly. My code snippet is below. Source DWG files I cannot convert are available to download from:
http://download.print-driver.com/ex/mb/aspose/acad.rar

Please let me know if you could fix this issue.

Mikhael

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Const sSrcDir = “D:\fGI Proekts – Mike version\test files kit\acad”
Const sOutDir = “D:\out\cad”

    Dim lst = GetListOfFiles(Path.Combine(sSrcDir, "*.dwg"), True)

    for each item in lst
        Try
            Using img = Aspose.CAD.Image.Load(item)
                Dim rasterizationOptions = New Aspose.CAD.ImageOptions.CadRasterizationOptions()
                rasterizationOptions.PageSize = New Aspose.CAD.SizeF(img.Width, img.Height)

                Dim opts = New Aspose.CAD.ImageOptions.PdfOptions()
                opts.VectorRasterizationOptions = rasterizationOptions

                Dim sOutFile = Path.Combine(sOutDir, GetFileName(item) + ".pdf")
                img.Save(sOutFile, opts)
            End Using
        Catch ex As Exception
            Console.WriteLine(item + " - FAILED")
        End Try
        
    Next

End Sub

@mikhaelbolgov,

I have observed your comments. Can you please share complete working sample project so that we may further investigate to help you out.

Here is the project:
http://download.print-driver.com/ex/mb/aspose/DWG-Test.rar

Please keep me updated about your research results.

@mikhaelbolgov,

I have worked with the DWF file shared and have been able to observe the issue. An issue with ID CADNET-641 has been created 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 automatically notified once the issue will be fixed.