Visit Gigasoft's Web Site
 ProEssentials v9 Help

Chapter 2: .NET Charts and Printing within the .NET Framework


You can print charts either via simple function calls or via low level API calls. There's also an example project for print and print preview.


Simple Printing of .NET Charts with Dialog Intervention:

PeFunction.Dialog.Print(bool fullPage, int width, int height)

Call this function to invoke a built-in print dialog. Setting fullPage to True ignores width and height which are in units of 1/100th millimeters. Related to the built-in print dialog are:


PeUserInterface.Dialog.PrintStyleControl of type ProEssentials.Enums.PrintStyleControl

Gets or Sets whether the user has access to selecting monochrome or color printing from the built-in print dialog.  Also controls whether dialog defaults to monochrome output.


PeUserInterface.Dialog.DefOrientation of type ProEssentials.Enums.DefOrientation

Gets or Sets default orientation of the printer paper when printing.

PeUserInterface.Dialog.PrintDpi of type Int32

Controls the target resolution in DotsPerInch when printing.

Set to Zero, the chart's image is sent to the printer via the actual graphic primitives and final resolution is based upon the printer's driver settings. This produces the sharpest graphics and may be the best setting when printing with ViewingStyle set to MonoChrome, BitmapGradientMode = False.


Set to 100 thru 600, the chart image is prepared as a bitmap (at the specified PrintDpi) and this bitmap is sent to the printer. The default and recommend setting is 300. 300 produces a good looking image while not requiring a huge amount of memory to be sent to the printer.


PeUserInterface.Dialog.HidePrintDpi of type Boolean

This property controls the visibility of the above PrintDpi end-user setting shown within the ProEssentials built-in print dialog.


Simple Printing of .NET Charts without Dialog Intervention:

PeFunction.PrintGraph(int width, int height, ProEssentials.Enums.DefOrientation orient)

Call to directly print image without dialog intervention.  width and height are in units of 1/100th millimeters, and if either are zero, outputs a full page.



Lower Level Printing or .NET Charts:

PeFunction.PrintGraphEx(int hDC, int width, int height int originX, int originY)

This function sends GDI or GDIPLUS commands to the target device context (hDC) to place the object's image within the printer's page at the size and position specified. The current state of PrintDpi and PrintTechnology properties will control which system calls are used to transfer the image.


ProEssentials includes example projects showing .NET's print/preview capabilities. These can be accessed via the shortcuts...


Start / All Programs / ProEssentials v9 / WPF-C#.NET WpfPrinting Project

Start / All Programs / ProEssentials v9 / C#.NET Print Preview Project
Start / All Programs / ProEssentials v9 / VB.NET Printing Example Project


These examples demonstrate various methods of printing within .NET. They show how to place multiple images on a page combined with other developer defined graphics and text.  This allows full control over page content. We recommend you study both examples before deciding on a printing method within your .NET projects.


Note that using ProEssentials' bitmap and gradient features will consume a large amount of printer resources, so if possible, we recommend setting BitmapGradientMode = False when printing. Especially if PrintDpi is set to zero.