English

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

Question

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

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>"]
 };

Related Information