Defines the layout template options used by the PrintTask to generate the print page.
Constructors
new PrintTemplate(properties)
properties Object See the properties for a list of all the properties that may be passed into the constructor. |
Property Overview
Name | Type | Summary | |
---|---|---|---|
Boolean | When | more details | |
String | The name of the class. more details | more details | |
Object | Define the map width, height and dpi. more details | more details | |
String | The output format for the printed map. more details | more details | |
String | The layout used for the print output. more details | more details | |
Object | Defines the layout elements. more details | more details | |
Number | The optional map scale of the printed map. more details | more details | |
Boolean | Define whether the printed map should preserve map scale or map extent. more details | more details | |
Boolean | When | more details |
Property Details
attributionVisibleBoolean
When
false
, the attribution is not displayed on the printout.Default Value: truedeclaredClassStringreadonly
The name of the class. The declared class name is formatted as
esri.folder.className
.exportOptionsObject
Define the map width, height and dpi. Required when
layout = 'map-only'
. See the object specification table below for available options to set for exportOptions.formatString
The output format for the printed map.
Known Values: pdf | png32 | png8 | jpg | gif | eps | svg | svgz
Default Value: png32layoutString
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:
Value Description map-only Map does not contain any layout elements. Only map image is printed. a3-landscape 16.54 x 11.69 in a3-portrait 11.69 x 16.54 in a4-landscape 11.69 x 8.27 in a4-portrait 8.27 × 11.69 in letter-ansi-a-landscape 11.0 x 8.5 in letter-ansi-a-portrait 8.5 x 11.0 in tabloid-ansi-b-landscape 17.0 x 11.0 in tabloid-ansi-b-portrait 11.0 x 17.0 in Default Value: map-onlylayoutOptionsObject
Defines the layout elements. It's an object with the following properties:
Properties:titleText StringThe text used for the map title if the specified layout contains a title text element.
authorText StringThe text used for the author if the specified layout contains an author text element.
copyrightText StringThe text used for the copyright if the specified layout contains an copyright text element.
scalebarUnit StringThe unit used for the scalebar.
Known Values:'Miles' | 'Kilometers' | 'Meters' | 'Feet'.
Default Value'Miles'
.legendLayers LegendLayer[]An array of LegendLayer containing the id's of the layers that will be included in the legend. If
legendLayers
is not specified, all operational layers will be present in the legend. To specify that no layers will be included in the legend setlegendLayer = []
.customTextElements Object[]An array of name-value pairs. Use this property to update the text for custom text elements on the page layout. Values must be strings.
Example:layoutOptions: { titleText: "My Print", authorText: "Sam", copyrightText: "My Company", scalebarUnit: "Miles", // the following text elements must // exist in your print service customTextElements: [{ "description": "My description", "location": "My Location" }] }
outScaleNumber
The optional map scale of the printed map. Only applies when
preserveScale = true
. IfoutScale
is less than 1, then the printed map will use the scale of the input map.Default Value: 0preserveScaleBoolean
Define whether the printed map should preserve map scale or map extent. If
true
, the printed map will use theoutScale
property or default to the scale of the input map. Iffalse
, the printed map will use the same extent as the input map and thus scale might change.Default Value: trueshowLabelsBoolean
When
true
, labels will be shown on the layout.Default Value: true