Silent Printing
Moderators: SDS, support, admin
Silent Printing
Hi,
I just downloaded your CADImport.net library yesterday and I've been trying to us it to print DWG files in the background. We are doing this so we can stream line our processes internally and have our paperwork printed pre-grouped.
My first attempt at doing this was using the following code:
I get the prompt to select a printer, I click print, no errors occur BUT nothing prints
Second attempt using the viewer which contains a CADImage object within it
Keep in mind that for this code the viewer was dropped on a form
This returns errors such as error in Draw method: VAlue of 'NaN' is not valid for 'emSize'...
If I run LoadFile wait 3 seconds and then run Print... it all works. Obviously something to do with it completing loading.
By the way, how do you reference XRef paths?
If we can get this to work (silent DWG printing), we will purchase a license for sure.
I just downloaded your CADImport.net library yesterday and I've been trying to us it to print DWG files in the background. We are doing this so we can stream line our processes internally and have our paperwork printed pre-grouped.
My first attempt at doing this was using the following code:
Code: Select all
CADImport.CADImage dwg = new CADImport.CADImage();
dwg.LoadFromFile("c:\\test.dwg");
this.dwg.Print(true, true, "HP Laserjet 1022n");
Second attempt using the viewer which contains a CADImage object within it
Keep in mind that for this code the viewer was dropped on a form
Code: Select all
this.cadViewerControl1.LoadFile("c:\\test.dwg");
this.cadViewerControl1.Image.Print(false, true, "HP Laserjet 1022n");
If I run LoadFile wait 3 seconds and then run Print... it all works. Obviously something to do with it completing loading.
By the way, how do you reference XRef paths?
If we can get this to work (silent DWG printing), we will purchase a license for sure.
Re: Silent Printing
Hello.
Your first code sample didn't worked because dwg must be created as instanse of CADImport.DWGImage class to load dwg files. CADViewerControl.LoadFile creates image object depends on loaded file extension. However, we aren't encountered any error messages in Draw or other methods. Please try to load other DWG files or files with other extension, CGM for example. If problem occur with some specific file, send it to support@cadsofttools.com, if possible. Also please specify the dll version you have used.
XRefs' paths searched when loading file. If path is valid, XRef will be added to image as an insert.
Alexander.
Your first code sample didn't worked because dwg must be created as instanse of CADImport.DWGImage class to load dwg files. CADViewerControl.LoadFile creates image object depends on loaded file extension. However, we aren't encountered any error messages in Draw or other methods. Please try to load other DWG files or files with other extension, CGM for example. If problem occur with some specific file, send it to support@cadsofttools.com, if possible. Also please specify the dll version you have used.
XRefs' paths searched when loading file. If path is valid, XRef will be added to image as an insert.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support