Silent Printing

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
SoupMan
Posts: 7
Joined: 05 Jan 2010, 18:30

Silent Printing

Post by SoupMan » 05 Jan 2010, 19:24

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:

Code: Select all

            CADImport.CADImage dwg = new CADImport.CADImage();
            dwg.LoadFromFile("c:\\test.dwg");
            this.dwg.Print(true, true, "HP Laserjet 1022n");
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

Code: Select all

            this.cadViewerControl1.LoadFile("c:\\test.dwg");
            this.cadViewerControl1.Image.Print(false, true, "HP Laserjet 1022n");
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.

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Silent Printing

Post by support » 08 Jan 2010, 17:05

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.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply