GetLayoutTemplatesInfo

Titleā€ƒ GetLayoutTemplatesInfo

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

<LI><P>This tool is intended to be published as a geoprocessing task within a printing service. It is also used by the preconfigured PrintingTools service.</P></LI><LI><P> The output of this tool is a string formatted as JSON. The string is a list of available map documents (used as layout templates) and the following information:</P><UL><LI>The size of the page layout</LI><LI>The size of the active data frame</LI><LI>Availability of following layout elements:<UL><LI>Legend element</LI><LI>Title text element</LI><LI>Copyright text element</LI><LI>Author text element</LI><LI>Custom text elements and their names and existing values </LI></UL></LI></UL><P>The sizes are returned in the unit that is saved with the map document.</P><code><P>A sample output JSON</P>[{ "layoutTemplate": "A4 Landscape", //name of the layout "pageSize": [29.7, 21], //page size "activeDataFrameSize": [27.75, 15.91], //size of the active data frame "layoutOptions": { "hasAuthorText": true, //is the predefined AuthorText available "hasCopyrightText": true, //is the predefined CopyrightText available "hasTitleText": true, //is the predefined TitleText available "hasLegend": true, //is legend element available "customTextElements": [] } }, { "layoutTemplate": "MyTemplatesWithCustomTextElements", "pageSize": [11, 8.5], "activeDataFrameSize": [6.65, 7.34], "layoutOptions": { "hasAuthorText": false, "hasCopyrightText": true, "hasTitleText": true, "hasLegend": true, "customTextElements": [ //available list of custom text elements { "CityName": "Redlands" }, { "MapCenterCoordinates": "" }, { "SelectedParcelID": ""} ] } }]</code></LI><LI><P>The tool should use the same folder location that is used by the associated Export Web Map tool.</P></LI><LI><P>For more information, see Printing in web applications in the ArcGIS Enterprise help.</P></LI>


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

layout

Credits

Use limitations