Skip To ContentArcGIS for DevelopersSign In Dashboard

TemplateOptions

require(["esri/widgets/Print/TemplateOptions"], function(TemplateOptions) { /* code goes here */ });
Class: esri/widgets/Print/TemplateOptions
Inheritance: TemplateOptions Accessor
Since: ArcGIS API for JavaScript 4.6

Defines the layout template options used by the Print widget to generate the print page.

See also:
Example:
templateOptions = new TemplateOptions({
  title: "My Print",
  author: "Sam",
  copyright: "My Company",
  legendEnabled: false
});

Constructors

new TemplateOptions(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryClass
Boolean

When false, the attribution is not displayed on the printout.

more details
more detailsTemplateOptions
String

The text used for the author if the specified layout contains an author text element.

more details
more detailsTemplateOptions
String

The text used for the copyright if the specified layout contains an copyright text element.

more details
more detailsTemplateOptions
String

The name of the class.

more details
more detailsAccessor
String

Resolution in dots per inch.

more details
more detailsTemplateOptions
Boolean

When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering.

more details
more detailsTemplateOptions
String

The output format for the printed map.

more details
more detailsTemplateOptions
Number

Map height.

more details
more detailsTemplateOptions
String

The layout used for the print output.

more details
more detailsTemplateOptions
Boolean

When false, the legend is not displayed on the printout.

more details
more detailsTemplateOptions
Boolean

When true, scale is used in the printed map.

more details
more detailsTemplateOptions
String

The text used for the map title if the specified layout contains a title text element.

more details
more detailsTemplateOptions
Number

Map width.

more details
more detailsTemplateOptions

Property Details

attributionEnabled 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
author String

The text used for the author if the specified layout contains an author text element.

The text used for the copyright if the specified layout contains an copyright text element.

declaredClass Stringreadonly inherited
Since: ArcGIS API for JavaScript 4.7

The name of the class. The declared class name is formatted as esri.folder.className.

dpi String

Resolution in dots per inch.

Default Value:96
forceFeatureAttributes Boolean
Since: ArcGIS API 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. Only applicable to custom print services which use the feature attributes, for example to display a table of features and their attributes.

Default Value:false
format String

The output format for the printed map.

Possible Values: pdf | png32 | png8 | jpg | gif | eps | svg | svgz

Default Value:pdf
height Number

Map height. This only applies when the layout value is map-only.

layout String

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, title, 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:

ValueDescription
map-onlyMap does not contain any layout elements. Only map image is printed.
a3-landscapeA3 Landscape
a3-portraitA3 Portrait
a4-landscapeA4 Landscape
a4-portraitA4 Portrait
letter-ansi-a-landscapeLetter ANSI A Landscape
letter-ansi-a-portraitLetter ANSI A Portrait
tabloid-ansi-b-landscapeTabloid ANSI B Landscape
tabloid-ansi-b-portraitTabloid ANSI B Portrait
Default Value:letter-ansi-a-landscape
legendEnabled Boolean

When false, the legend is not displayed on the printout.

Default Value:true
scaleEnabled Boolean

When true, scale is used in the printed map.

Default Value:false
title String

The text used for the map title if the specified layout contains a title text element.

width Number

Map width. This only applies when the layout value is map-only.

API Reference search results

NameTypeModule
Loading...