Has anybody ever printed a 2D-View

For a long time I try to get an EMF-File form a 2D View.

My code looks like this:

Handle_WNT_DDriver myWNTDriver;
myWNTDriver = new WNT_DDriver(cPrn, "spool.emf", WNT_OT_LANDSCAPE, 1.0, 1);

myWNTDriver->Spool(Aspect_PM_DPLOTTER, cPrn, Standard_True);

When I debuged the OpenCascade-Functions and realised, that the sizes and scaling factors of the outputdriver are wrong. Thats why during the Graphic2d_View::Update()-call all the primitives are not repainted because of the clipping-check. (Graphic2d_Drawer::IsIn() is false for all primitives)

Could anybody help me?
Has anybody ever printed a 2D-View in OCC5.1?
Is the plotting-function forgotten / not fully implemented?

Thanks for your reply...

Valery Ovchinnikov's picture

I have the same problem. I suppose this question must be in FAQ already. This question was in the forum several times, but there was only one real way: to use a bitmap with high resolution and to print it through Windows API, not OCC.

If somebody finds a decision, please, write here or may be could you to send a sample code to me: vl_o[at]hotbox[dot]ru


Valery Ovchinnikov's picture

About bitmap. From FAQ, but about view3d:

CString filename ("myView3D.bmp");
myView->Dump (filename, Aspect_FOSP_A4);
myView is the V3d_View which is in the viewer and into which Open CASCADE objects are displayed using, for example, AIS services.

Notes :

The file name extension can be any among ".xwd", ".gif", or ".bmp" formats both on UNIX or NT.

Be careful about dump time requirements of the resulting file, especially for the A formats.

The GIF format generates very small files, BMP and XWD generates much larger files (4 to 6 times the size of a GIF).

The time to generates these files is very short with the XWD format but 2 to 4 times longer for the other formats.