Convert DWG to PDF File.
Moderators: SDS, support, admin
-
- Posts: 19
- Joined: 31 Aug 2017, 09:47
Convert DWG to PDF File.
Please let me know how i could convert a DWG to PDF file ?
Thanks
Thangaraj N
Thanks
Thangaraj N
Re: Convert DWG to PDF File.
Hello,
DWG to PDF conversion is performed in two steps:
1) Reading the DWG file to a CADImage object.
2) Saving the CADImage object to a PDF file using a CADToPDF class.
Mikhail
DWG to PDF conversion is performed in two steps:
1) Reading the DWG file to a CADImage object.
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"));
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 19
- Joined: 31 Aug 2017, 09:47
Re: Convert DWG to PDF File.
I did tried to export the PDF, But i'm getting a blank page. Also i have few colored layer and i want the background to be printed as black when exported(Same as in CAD). Please provide some suggestions.
Re: Convert DWG to PDF File.
Hello,
To produce a PDF with black background, add the following line to the PDF export routine:
As for the problem with a blank page, please send us the .dwg and .pdf files for investigation.
Mikhail
To produce a PDF with black background, add the following line to the PDF export routine:
Code: Select all
pdfExporter.Settings.BackgroundColor = Color.Black.ToArgb();
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 19
- Joined: 31 Aug 2017, 09:47
Re: Convert DWG to PDF File.
Can you please let me know how i can upload the file. It is more than 1 MB.
Thanks
Thangaraj N
Thanks
Thangaraj N
Re: Convert DWG to PDF File.
Hello,
You can send the files to the Technical Support e-mail or via Skype.
Mikhail
You can send the files to the Technical Support e-mail or via Skype.
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support