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

<DIV STYLE="text-align:Left;"><DIV><DIV><UL><LI><P><SPAN>This tool is intended to be published as a geoprocessing task within a printing service. It is also used by the preconfigured PrintingTools service.</SPAN></P></LI><LI><P><SPAN> 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:</SPAN></P><UL><LI><P><SPAN>The size and units of the page layout</SPAN></P></LI><LI><P><SPAN>The size of a map frame</SPAN></P><UL><LI><P><SPAN>If there are multiple map frames on the layout, it returns information only for the map frame that is named WEBMAP_MAP_FRAME </SPAN></P></LI></UL></LI><LI><P><SPAN>Availability of following layout elements:</SPAN></P><UL><LI><P><SPAN>Legend element</SPAN></P></LI><LI><P><SPAN>Title text element</SPAN></P></LI><LI><P><SPAN>Copyright text element</SPAN></P></LI><LI><P><SPAN>Author text element</SPAN></P></LI><LI><P><SPAN>Custom text elements and their names and existing values </SPAN></P></LI></UL></LI></UL><P><SPAN>The sizes are returned in the unit that is saved with the layout file.</SPAN></P><P><SPAN>A sample output JSON</SPAN></P><P><SPAN>[{ "layoutTemplate": "A4 Landscape", //name of the layout "pageSize": [29.7, 21], //page size "pageUnits": "CENTIMETER", //page units "activeDataFrameSize": [27.75, 15.91], //size of the map 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], "pageUnits": "INCH", "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": ""} ] } }]</SPAN></P></LI><LI><P><SPAN>The tool should use the same folder location that is used by the associated Export Web Map tool.</SPAN></P></LI><LI><P><SPAN>For more information, see Printing in web applications in the ArcGIS Enterprise help.</SPAN></P></LI></UL></DIV></DIV></DIV>


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

data frame size, dataframe size, export web map, exportwebmap, layout, map, print, print service, printing, printing service, server, template, text element, textelement, title, web map, web print service, web printing, web printing service, webmap

Credits

Use limitations