This document is archived and information here might be outdated.  Recommended version.


Exporting maps (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > Developing with ArcGIS > Learning ArcObjects > Exporting and printing maps > Exporting maps

Exporting maps


In this topic


About exporting maps

The following topics outline the basics of exporting maps from the developer standpoint. Important tasks or new functionalities are also outlined in the how to topics.
For more information, see the Output library overview.

Exporting maps and page layouts with minimum code

If your goal is to export a Map or PageLayout view to a file with the fewest lines of code, use the PrintAndExport class located in the Carto library. The class is used together with the export classes (for example, ExportPNG, ExportPDF, and so on) to produce the graphics export files. Because it handles pixel resizing, output image quality, visible bounds management, and other intricacies internally, it is the easiest way to export a map to a graphics file. 
The PrintAndExport class is also the only mechanism available in ArcObjects to produce an output of data driven pages. For more information, see the ArcGIS for Desktop Help topic, What are Data Driven Pages?. Data driven pages provide the built-in map book functionality in ArcGIS.
The best way to get started exporting maps and page layouts is to use the code provided in the Export active view sample.
The PrintAndExport class is contained in the Carto library.
The primary workflow for building map books from ArcGIS is to use Python scripting to orchestrate and output map book content. These workflows are supported through the arcpy.mapping application programming interface (API), part of the ArcGIS geoprocessing framework. For more information, see DataDrivenPages for the arcpy.mapping Python class.

Exporting maps and page layouts with fine grained control

Most ArcObjects applications that need to export maps can produce the necessary output using only the steps outlined in the Export active view sample. However, if you are implementing an extension that requires fine grained control for the calculation of VisibleBounds, PixelBounds, or other export and display parameters, implement a fine-grained export routine instead of using the PrintAndExport class. To accomplish this, use the StartExporting and FinishExporting methods from the IExport interface together with the Output method from IActiveView.