Get Layout Templates Info

Titleā€ƒ Get Layout Templates Info

Summary

Returns the content of layout templates in JavaScript Object Notation (JSON) format. Layout files (.pagx files) located in a folder are used as layout templates.


Usage

This tool is intended to be published as a geoprocessing task within a printing service. It is also used by the preconfigured PrintingTools service.

The output of this tool is a string formatted as JSON. The string is a list of available layout files (.pagx files) and the following information:

The size and units of the page layout The size of a map frameIf there are multiple map frames on the layout, it returns information only for the map frame that is named WEBMAP_MAP_FRAME Availability of following layout elements:Legend elementTitle text elementCopyright text elementAuthor text elementCustom text elements and their names and existing values

The sizes are returned in the unit that is saved with the layout file.

A sample output JSON

The tool should use the same folder location that is used by the associated Export Web Map tool.

For more information, see Printing in web applications in the ArcGIS Enterprise help.


Syntax

Code Samples

GetLayoutTemplatesInfo example (Python window)

The following script returns a list of metadata for each layout.


import arcpy
arcpy.GetLayoutTemplatesInfo_server(r'C:\Data\MyLayouts')

                    

Tags

Credits

Use limitations