CustomTemplate

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

Defines the custom layout template options used by the Print widget to generate the print page. While custom templates can be published from ArcGIS Pro to a portal, custom layout templates are defined in a portal, where they can be added, removed, or edited as necessary without having to republish the print service. There are a limited number of options available for customization.

The main benefit of this class is that is allows developers to give a name to a preferred format and layout and if there should be a Legend present or not, in a reusable way. This is what the UI looks like in a portal:

Create-Print-Template

See also:

Constructors

new CustomTemplate(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
String

The name of the class.

more details
more detailsAccessor
String

The template's description.

more details
more detailsCustomTemplate
String

The output format for the printed map.

more details
more detailsCustomTemplate
String

The text that appears inside the Print Widget's Select template button.

more details
more detailsCustomTemplate
String

The layout used for the print output.

more details
more detailsCustomTemplate
Object

Defines the layout elements.

more details
more detailsCustomTemplate

Property Details

declaredClass Stringreadonly inherited

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

description Stringreadonly

The template's description.

format String

The output format for the printed map.

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

Default Value:pdf
label Stringreadonly

The text that appears inside the Print Widget's Select template button. This is the label for the template as defined in a portal.

layout Stringreadonly

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:

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

Possible Values:"map-only"|"a3-landscape"|"a3-portrait"|"a4-landscape"|"a4-portrait"|"letter-ansi-a-landscape"|"letter-ansi-a-portrait"|"tabloid-ansi-b-landscape"|"tabloid-ansi-b-portrait"

Default Value:letter-ansi-a-landscape
layoutOptions Objectreadonly

Defines the layout elements. It's an object with the following property:

Property:
legend Boolean
optional

Indicates whether the legend will be included in the print-out.

API Reference search results

NameTypeModule
Loading...