Export Web Map (Server)

Summary

Returns a printable page layout or basic map of a specified area of interest based on the state of a web app (for example, included services, layer visibility settings, and client-side graphics).

Usage

  • The input for this tool is text in JSON format describing the layers, graphics, and other settings in the web map. The JSON representation must be structured according to the ExportWebMap specification.

  • This tool is included in ArcGIS Server to support web services for printing, including the PrintingTools preconfigured service. ArcGIS API for JavaScript uses the PrintingTools service to generate images for map printing.

  • For advanced printing scenarios, such as swapping service layers for local vector data or creating map books, use the ConvertWebMapToArcGISProject function in the Python arcpy.mp module instead of this tool. To make a Python script available to a web app, you can expose the script through an ArcGIS Server geoprocessing service. For more information, see Printing in web applications in the ArcGIS Server help.

  • The TIFF export format type generates a geo-enabled 32-bit .tiff file with an alpha channel.

  • The folder specified in the Templates Folder parameter cannot contain two or more files (.rptt and .rptx) with identical names. This is to avoid undesirable outputs during print jobs. Layout and report templates can share the same name.

  • If a report template is used or specified, the output must be in PDF format.

Parameters

LabelExplanationData Type
Web Map as JSON

A JSON representation of the state of the map to be exported as it appears in the web app. See the ExportWebMap specification to understand how to format this text. ArcGIS API for JavaScript allows you to get this JSON string from the map.

String
Output File

The output file name. The extension of the file depends on the Format parameter value.

File
Format
(Optional)

Specifies the format in which the map image for printing will be delivered.

  • 8-bit Portable Network Graphics (PNG8)8-bit Portable Network Graphics (PNG8) will be used. This is the default.
  • Portable Document Format (PDF)Portable Document Format (PDF) will be used.
  • 32-bit Portable Network Graphics (PNG32)32-bit Portable Network Graphics (PNG32) will be used.
  • Joint Photographic Experts Group (JPG) Joint Photographic Experts Group (JPG) will be used.
  • Graphics Interchange Format (GIF) Graphics Interchange Format (GIF) will be used.
  • Encapsulated PostScript (EPS) Encapsulated PostScript (EPS) will be used.
  • Scalable Vector Graphics (SVG)Scalable Vector Graphics (SVG) will be used.
  • Compressed Scalable Vector Graphics (SVGZ)Compressed Scalable Vector Graphics (SVGZ) will be used.
  • Adobe Illustrator Exchange (AIX)Adobe Illustrator Exchange (AIX) will be used.
  • Tag Image File Format (TIFF)Tag Image File Format (TIFF) will be used.
Note:

The background of the output file is always opaque.

String
Templates Folder
(Optional)

The full path to the folder containing layout or report pages (.pagx, .rptx, and .rptt files) to be used as templates. The default location is <install_directory>\Resources\ArcToolBox\Templates\ExportWebMapTemplates.

Folder
Layout Template
(Optional)

The name of a template from the list or the keyword MAP_ONLY. When MAP_ONLY is used or an empty string is passed in, the output map will not contain any page layout elements such as title, legend, or scale bar.

String
Layout Item ID
(Optional)

The portal ID (in JSON format) of the layout item that will be used for templates. Use the format: {"id": "<portal-id>"}. When a value is provided, this parameter takes precedence over the Layout Template parameter.

String
Report Template
(Optional)

The name of the report template.

When this parameter value is provided, the Format parameter must be set to Portable Document Format (PDF). When this parameter is unspecified, the output file will not contain any reports.

String
Report Item ID
(Optional)

The portal ID (in JSON format) of the report item that will be used for templates. Use the format: {"id": "<portal-id>"}. When a value is provided, this parameter takes precedence over the Report Template parameter.

String

arcpy.management.ExportWebMap(Web_Map_as_JSON, Output_File, {Format}, {Layout_Templates_Folder}, {Layout_Template}, {Layout_Item_ID}, {Report_Template}, {Report_Item_ID})
NameExplanationData Type
Web_Map_as_JSON

A JSON representation of the state of the map to be exported as it appears in the web app. See the ExportWebMap specification to understand how to format this text. ArcGIS API for JavaScript allows you to get this JSON string from the map.

String
Output_File

The output file name. The extension of the file depends on the Format parameter value.

File
Format
(Optional)

Specifies the format in which the map image for printing will be delivered.

  • PNG88-bit Portable Network Graphics (PNG8) will be used. This is the default.
  • PDFPortable Document Format (PDF) will be used.
  • PNG3232-bit Portable Network Graphics (PNG32) will be used.
  • JPG Joint Photographic Experts Group (JPG) will be used.
  • GIF Graphics Interchange Format (GIF) will be used.
  • EPS Encapsulated PostScript (EPS) will be used.
  • SVGScalable Vector Graphics (SVG) will be used.
  • SVGZCompressed Scalable Vector Graphics (SVGZ) will be used.
  • AIXAdobe Illustrator Exchange (AIX) will be used.
  • TIFFTag Image File Format (TIFF) will be used.
Note:

The background of the output file is always opaque.

String
Layout_Templates_Folder
(Optional)

The full path to the folder containing layout or report pages (.pagx, .rptx, and .rptt files) to be used as templates. The default location is <install_directory>\Resources\ArcToolBox\Templates\ExportWebMapTemplates.

Folder
Layout_Template
(Optional)

The name of a template from the list or the keyword MAP_ONLY. When MAP_ONLY is used or an empty string is passed in, the output map will not contain any page layout elements such as title, legend, or scale bar.

String
Layout_Item_ID
(Optional)

The portal ID (in JSON format) of the layout item that will be used for templates. Use the format: {"id": "<portal-id>"}. When a value is provided, this parameter takes precedence over the Layout_Template parameter.

String
Report_Template
(Optional)

The name of the report template.

When this parameter is provided, the Format parameter must be set to PDF. When this parameter is unspecified, the output file will not contain any reports.

String
Report_Item_ID
(Optional)

The portal ID (in JSON format) of the report item that will be used for templates. Use the format: {"id": "<portal-id>"}. When a value is provided, this parameter takes precedence over the Report_Template parameter.

String

Environments

This tool does not use any geoprocessing environments.