Frequently asked question

Is it possible to print customTextElement in ArcGIS API for JavaScript?

Last Published: September 1, 2021

Answer

It is possible to print customTextElement by using the PrintTemplate() method in ArcGIS API for JavaScript. The customTextElement parameter is an array of name-value pairs required if a user wants to update text of a TextElement, which is not a DynamicText on the page layout. The values of customTextElement must be of type string.

The following code snippet describes how to print customTextElement using JavaScript:

var plate = new PrintTemplate();

 plate.layout = plate.label = ch;
 plate.format = "PDF";
 plate.layoutOptions = {
 "authorText": "Made by: Esri's JS API Team",
 "copyrightText": "<copyright info here>",
 "legendLayers": [],
 "titleText": "Pool Permits",
 "scalebarUnit": "Miles",
 "customTextElement": [{"<textElementName1>" : "<value1>"}]
 };

Article ID:000014409

Software:
  • ArcGIS API for JavaScript 3 x
  • ArcGIS API for JavaScript 4 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options