Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Collapse]Map Control
   [Expand]Getting Started
    Layers
   [Expand]Coordinate Systems
   [Expand]Map Image Data
   [Expand]GIS Data
   [Expand]Vector Data
   [Expand]Visual Elements
   [Collapse]End-User Interaction
     Highlighting
     Selection
     Tooltips
     Printing and Exporting
     Scrolling and Zooming
   [Expand]Examples
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Printing and Exporting

The Map control makes it possible to print a map and export it to numerous file formats.

Make sure that your project references the DevExpress.Xpf.Printing.18.1 and DevExpress.Printing.v18.1.Core assemblies to be capable to perform the following tasks.

Expanded Invoke the Print Preview Window

Use one of the following methods to invoke the Print Preview with a toolbar or the Print Preview with a Ribbon.

MethodDescription
MapControl.ShowPrintPreview Invokes the Print Preview window, which shows the print preview of the Map control.
MapControl.ShowPrintPreviewDialog Invokes the modal Print Preview window, which shows the print preview of the Map control.
MapControl.ShowRibbonPrintPreview Invokes the Print Preview window with a Ribbon for the Map control.
MapControl.ShowRibbonPrintPreviewDialog Invokes the Print Preview modal dialog with a Ribbon for the Map control.

The code below shows how to invoke the Print Preview form with the Ribbon on the button click event.

Expanded Print a Map

The Print Preview allows you to immediately print a map using default settings or to configure the required options before printing.

  1. To print a map using the default printer and predefined settings, click Quick Print.


  2. To change settings before printing, select the Print... item.


    In the Print... dialog, configure settings and click OK to print a map.

Expanded Export a Map

The Map control provides several ways to export a map.

  1. To export a map to the desired file format from code, use one of the following methods.

    PropertyDescription
    MapControl.ExportToHtml Exports a map to an HTML file.
    MapControl.ExportToImage Exports a map to an image.
    MapControl.ExportToMht Exports a map to an MHT file.
    MapControl.ExportToPdf Exports a map to a PDF file.
    MapControl.ExportToRtf Exports a map to an RTF file.
    MapControl.ExportToXls Exports a map to an XLS file.
    MapControl.ExportToXlsx Exports a map to an XLSX file.
    MapControl.ExportToXps Exports a map to an XPS file.
    MapControl.ExportToDocx Exports a map to a DOCX file.

    The code below shows how to export a map to the specified PDF file on the button click event.

    In addition, you can export a map vector layer's content to one of the supported formats using the following methods.

    MethodDescription
    VectorLayerBase.ExportToKml Exports data from a vector layer using the KML file format.
    VectorLayerBase.ExportToSvg Exports data from a vector layer using the SVG file format.
    VectorLayerBase.ExportToShp Exports vector layer data to the specified shapefile.

    Use the following code to export the map's vector data to the specified KML file.

  2. You can export a map using the Print Preview window. To do this, select the desired format in the Export item's drop-down list.


    In the Export Document... window, configure exporting options and click OK.

Expanded Configure Map Print/Export Settings

It is possible to change the map's print/export options, for instance, size mode. To do this, use the following markup.

The code above uses the following classes and properties.

Class or PropertyDescription
MapControl.PrintOptions Gets or sets print options of the Map control.
MapPrintOptions Stores map print options.
MapPrintOptions.PrintMiniMap Specifies whether to print/export a mini map.
MapPrintOptions.SizeMode Specifies a map size mode. To set this property, use items of the MapPrintSizeMode enumeration.

Expanded See Also

Is this topic helpful?​​​​​​​