Page 1 of 1

DWG - PDF

Posted: 09 Jan 2021, 22:20
by FrankBacker
Please let me know how i could convert a DWG to PDF file ?

Thanks for alot.

Re: DWG - PDF

Posted: 12 Jan 2021, 00:25
by support
Hello Frank,

Please use the following code.

Code: Select all

public static void ConvertDWGtoPDF(string dwgFilePath, string pdfFilePath)
{
    CADImage cadImage = CADImage.CreateImageByExtension(dwgFilePath);
    cadImage.IsWithoutMargins = true;
    cadImage.LoadFromFile(dwgFilePath);
    Export.CADToPDF pdf = new Export.CADToPDF(cadImage);
    pdf.SaveToFile(pdfFilePath);
}
Mikhail