ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Get Layout Templates Info

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

This tool takes a folder location where map documents (.mxd files) to be used as layout templates are located and returns the content of those layout templates formatted as JavaScript object notation (JSON).

Usage

  • This tool is shipped with ArcGIS Server and 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 map documents (used as layout templates) and the following information:

    • The size of the page layout
    • The size of the active data frame
    • Availability of following layout elements:
      • Legend element
      • Title text element
      • Copyright text element
      • Author text element
      • Custom text elements and their names and existing values
    Note:

    The sizes are returned in the unit that is saved with the map document.

    A sample output JSON

    [{
      "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": ""}
        ]  
    }
    }]
    
  • 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 Server help.

Syntax

GetLayoutTemplatesInfo_server ({Layout_Templates_Folder})
ParameterExplanationData Type
Layout_Templates_Folder
(Optional)

Full path to the folder where map documents (.mxd files) to be used as layout templates are located. The default location is <install_directory>\Templates\ExportWebMapTemplates.

Folder

Code sample

The following script returns a list of metadata for each layout from all MXDs in a folder.

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

Environments

This tool does not use any geoprocessing environments.

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2017 Esri. | Privacy | Legal