import TemplateOptions from "@arcgis/core/widgets/Print/TemplateOptions.js";const TemplateOptions = await $arcgis.import("@arcgis/core/widgets/Print/TemplateOptions.js");- Inheritance:
- TemplateOptions→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.6
Defines the layout template options used by the Print widget and Print component to generate printed output.
- See also
Print widget - Deprecated since 4.33. Use the Print component instead.
Example
const templateOptions = new TemplateOptions({ title: "My Print", author: "Sam", copyright: "My Company", legendEnabled: false});Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| | ||
| | ||
| | ||
| | ||
declaredClass readonly inherited | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
id readonly | | |
| | ||
| | ||
PortalItem | null | undefined | | |
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
state readonly | "ready" | "pending" | "error" | |
| | ||
| |
attributionEnabled
- Type
- boolean
When false, the attribution is not displayed on the printout.
This only applies when the layout value is map-only.
Reference our policies on Licensing & Attribution for specific attribution requirements.
- Default value
- true
fileName
- Since
- ArcGIS Maps SDK for JavaScript 4.14
This property only applies when the layout value is map-only. If the layout
value is not map-only, see title.
If the application and the print service are on the same origin, this property defines the file name of the downloadable printed map, and the title of the map in the printout. Clicking on the download icon or the file name will download the printed map.

If the application and the print service are not on the same origin, this property defines the title of the map in the printout. The file name of the downloadable printed map will be generated by the ArcGIS Enterprise that hosts the print service. Clicking on the external link icon or the file name will open the printed map in a new window.

forceFeatureAttributes
- Type
- boolean
- Since
- ArcGIS Maps SDK for JavaScript 4.8
When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering. By default they are removed to reduce the request size.
- Default value
- false
includeTables
- Type
- boolean
- Since
- ArcGIS Maps SDK for JavaScript 4.28
When true, tables will be included in the printout request.
A table is a non-spatial dataset in a feature service or map service.
Note that for the table to display in the printout, the print template must be configured to support tables.
- See also
- Default value
- true
layout
- Type
- PrintLayoutTemplate | null | undefined
The layout used for the print output. When the value is map-only or is empty, the output map does not contain any page layout
surroundings (for example: legend, scale bar, and so forth). The print service provides out-of-the-box templates listed in possible values.
The server administrator can add additional templates to the print service.
Possible values are listed below:
| Value | Description |
|---|---|
| map-only | Map does not contain any layout elements. Only map image is printed. |
| a3-landscape | A3 Landscape |
| a3-portrait | A3 Portrait |
| a4-landscape | A4 Landscape |
| a4-portrait | A4 Portrait |
| letter-ansi-a-landscape | Letter ANSI A Landscape |
| letter-ansi-a-portrait | Letter ANSI A Portrait |
| tabloid-ansi-b-landscape | Tabloid ANSI B Landscape |
| tabloid-ansi-b-portrait | Tabloid ANSI B Portrait |
- Default value
- "letter-ansi-a-landscape"
layoutItem
- Type
- PortalItem | null | undefined
- Since
- ArcGIS Maps SDK for JavaScript 4.29
A custom layout hosted as a portal item. To use this property, the print service must be hosted on an ArcGIS Server that is federated with the same portal as the portal item.
Known Limitations
This capability is only available with ArcGIS Enterprise 11.1 or later.
scale
The map scale of the printed map. Only applies when scaleEnabled is true.
title
The text used for the map title if the specified layout contains a title text element.
This only applies if the layout value is not map-only. For map-only, see fileName.
If the application and the print service are on the same origin, this property defines the file name of the downloadable printed map, and the title of the map in the printout. Clicking on the download icon or the file name will download the printed map.

If the application and the print service are not on the same origin, this property defines the title of the map in the printout. The file name of the downloadable printed map will be generated by the ArcGIS Enterprise that hosts the print service. Clicking on the external link icon or the file name will open the printed map in a new window.
