Print directly to device, Print using enhanced metafile (emf), Implementing printing in your application – Pitney Bowes MapXtreme User Manual

Page 524

Advertising
background image

Appendix E: Printing From MapXtreme Applications

Implementing Printing in Your Application

MapXtreme v7.1

531

Developer Guide

patterns, you should set this value to true in order to prevent the printed output from displaying too
small and appearing like a solid fill. See

Need for Speed When Using Fill Patterns?

for details

about which fill patterns are bitmaps and which are vectors.

If this property is set to true, the print preview and the resulting printed document may not look the
same, as the printer driver scales the pattern, but the display does not scale the pattern. It will print
correctly, even if the display doesn’t show it properly.

L

If a fill pattern has a background color it is considered non-transparent, while one without a
background color is considered a transparent fill and is always scaled, regardless of the
value of this property.

Print Directly to Device

This option allows you to print your image directly to your printer. Set this value with
PrintMethod.Direct.

Print Using Enhanced Metafile (EMF)

Use this option to generate an enhanced metafile of your image before sending it to the printer. This
option takes advantage of current printer technology to shrink the spool size and print your file
quicker without sacrificing quality. Set this value with PrintMethod.Emf.

Implementing Printing in Your Application

The printing namespace in MapXtreme contains a set of classes to help you print maps. Use these
classes to handle basic printing of maps to any connected printing device.

Use the MapPrinting class to access the dialogs and printer control dialogs. It is important to allocate
a single MapPrinting object for your application and use this same instance for print/print-
preview/page setup.

Setup a MapPrinting and assign a map:

this.mapPrinting = new MapPrinting();
this.mapPrinting.Map = this.mapControl1.Map;

Following is sample code to print a map:

this.mapPrinting.ShowDialog = true;
this.mapPrinting.Print();

Following is sample code to display a print preview of a map:

this.mapPrinting.PrintPreview();

Following is sample code to show the Page Setup dialog:

Advertising