Skip to main content

MapSeriesExportOptions

Summary

The MapSeriesExportOptions object represents a collection of optional properties that can be used with the export method on the MapSeries and BookmarkMapSeries objects to configure how a map series is exported.

Discussion

This object is only needed if you want to export a MapSeries or BookmarkMapSeries with properties different than the default values.

The CreateExportOptions function can be used to create a MapSeriesExportOptions object if the class_type parameter is set to MAPSERIES. The returned object contains all the properties needed to configure how map series are exported.

Note:

Currently map series objects can only be exported to JPEGFormat, PNGFormat, PDFFormat and TIFFFormat.

Properties

Name Explanation Data type

customPages

(Read and Write)

A string that identifies the map series pages to be exported if the exportPages property is set to CUSTOM. For example, the following string would export 5 pages: 1, 3, 5-7. The default value is an empty string.

String

exportFileOptions

(Read only)

A string constant that represents how the pages will be exported. To change this value, use the setFileExportOptions method. The default value is PDF_SINGLE_FILE.

  • PDF_MULTIPLE_FILES_PAGE_NAME—Export each map series page to an individual file and append the page name to the file name. For example, Output.PDF will become Output_LakeErie.PDF.

  • PDF_MULTIPLE_FILES_PAGE_NUMBER—Export each map series page to an individual file and append the page number to the file name. For example, Output.PDF will become Output_1.PDF.

  • PDF_SINGLE_FILE—Export all pages into a multipage, single file document.

String

exportPages

(Read only)

A string constant that represents the collection of map series pages to be exported. To change this value, use the setExportPages method. The default value is ALL.

  • ALL—Export all pages in the map series.

  • CURRENT—Export the currently active page. This option only applies when running a script inside the application.

  • CUSTOM—Export a custom set of pages that is defined using the customPages property.

  • SELECTED_INDEX_FEATURES—Only export map series pages that correspond to the selected index features associated with the map series.

String

showExportCount

(Read and Write)

If set to True, you will see the status of each page being exported displayed in the Python shell. The default value is False.

Boolean

Methods

setExportFileOptions(export_file_options)

A string constant that represents how the pages will be exported.

The default value is PDF_SINGLE_FILE when exporting to PDFFormat. If you are exporting to JPEGFormat, [PNGFormat], or TIFFFormat, and you don't explicitly set this parameter, it will default to MULTIPLE_FILES_PAGE_NAME instead since only PDFFormat supports exporting multiple pages to a single file.

Name Explanation Data type

export_file_options

  • MULTIPLE_FILES_PAGE_NAME—Export each map series page to an individual file and append the page name to the file name. For example, Output.PDF will become Output_LakeErie.PDF.

  • MULTIPLE_FILES_PAGE_NUMBER—Export each map series page to an individual file and append the page number to the file name. For example, Output.PDF will become Output_1.PDF.

  • PDF_SINGLE_FILE—Export all pages into a multipage, single file document.

The default value is PDF_SINGLE_FILE.

String

setExportPages(export_pages)

A string constant that represents the collection of map series pages to be exported.

Name Explanation Data type

export_pages

  • ALL—Export all pages in the map series.

  • CURRENT—Export the currently active page. This option only applies when running a script inside the application.

  • CUSTOM—Export a custom set of pages that is defined using the customPages property.

  • SELECTED_INDEX_FEATURES—Only export map series pages that correspond to the selected index features associated with the map series.

String

Code sample

MapSeriesExportOptions example

The following script exports a MapSeries object using default PDFFormat properties but configures the MapSeriesExportOptions to export a custom set of map series pages.

p = arcpy.mp.ArcGISProject('current')
l = p.listLayouts('Layout_MS')[0]
ms = l.mapSeries

pdf = arcpy.mp.CreateExportFormat('PDF', r'c:\temp\MS_PDF.pdf')

msExOpt = arcpy.mp.CreateExportOptions('MAPSERIES')
msExOpt.setExportPages('CUSTOM')
msExOpt.customPages = '1-3'

ms.export(pdf, msExOpt)