Convert DWG to PDF File.
Posted: 10 Oct 2017, 17:15
Please let me know how i could convert a DWG to PDF file ?
Thanks
Thangaraj N
Thanks
Thangaraj N
CADSoftTools - AutoCAD DWG DXF HPGL (PLT) SVG CGM STEP IGES STL SAT viewers, converters and developer tools. Delphi and C# source code.
https://cadsofttools.com/forum/
Code: Select all
using CADImport;
...
string filePath = @"C:\test.dwg";
CADImage cadImage = CADImage.CreateImageByExtension(filePath);
cadImage.LoadFromFile(filePath);
cadImage.IsWithoutMargins = true;
Code: Select all
using CADImport.Export;
using System.IO;
...
CADToPDF pdfExporter = new CADToPDF(cadImage);
pdfExporter.Settings.LayoutsExportMode = LayoutsExportOption.All;
pdfExporter.Settings.DrawMode = CADDrawMode.Normal;
pdfExporter.Settings.IsShowLineWeight = true;
pdfExporter.Settings.LineWeightScale = 0;
pdfExporter.Settings.PageHeight = 17 * 25.4; // 17 inches converted to mm
pdfExporter.Settings.PageWidth = 11 * 25.4; // 11 inches converted to mm
pdfExporter.SaveToFile(Path.ChangeExtension(filePath, ".pdf"));
Code: Select all
pdfExporter.Settings.BackgroundColor = Color.Black.ToArgb();