Custom Text Elements in Print Template using Javascript API

508
4
Jump to solution
12-03-2021 11:25 PM
naveenbeti
New Contributor III

Hi 

naveenbeti_0-1638602107576.png

 We want to develop a print template as shown above where we get map and dynamic data into it. please suggest any ideas on it. we have gone through the customtextelements property in print parameters but no luck. please suggest on this.

 

When i try to get layout templates im getting below message. no custom text elements have been assigned. could anyone plz let me know how to configure that elements in it.

 

Get Layout Templates Info
=====================
Parameters

Layout Templates Folder C:\Templates
JSON String [
{
"layoutTemplate": "Layout",
"pageSize": [
420.0,
297.0
],
"pageUnits": "MILLIMETER",
"webMapFrameSize": [
331.8,
255.03
],
"layoutOptions": {
"hasTitleText": false,
"hasAuthorText": false,
"hasCopyrightText": false,
"hasLegend": false,
"customTextElements": []
}
}
]
=====================
Messages

Start Time: Saturday, December 4, 2021 9:21:16 AM
Succeeded at Saturday, December 4, 2021 9:21:17 AM (Elapsed Time: 0.31 seconds)

0 Kudos
2 Solutions

Accepted Solutions
Kishore
Occasional Contributor

Hi,

Please refer to the link below for publishing the Print service with custom layouts: Share custom layouts for printing from ArcGIS Pro 

The similar question was asked and solved in the case Add custom text element to print layout in print widget 

Thank you.

Regards,
Kishore

View solution in original post

Kishore
Occasional Contributor

Hi Naveen,

Add the "{}" braces to the Text element name. this will provide you the custom Text Elements. Please refer to the attachment.customTextElement.PNG

 

Regards,
Kishore

View solution in original post

4 Replies
Kishore
Occasional Contributor

Hi,

Please refer to the link below for publishing the Print service with custom layouts: Share custom layouts for printing from ArcGIS Pro 

The similar question was asked and solved in the case Add custom text element to print layout in print widget 

Thank you.

Regards,
Kishore

View solution in original post

naveenbeti
New Contributor III

Hi Kishore,

thanks for the links shared. I have gone through the links before posting here. My question is simple how to add dynamic text which will comes in the customtextelement array as shown in the second link. I tried to add elements to layout but when im running this get layout templates info gp tool. Im getting onlyhasCopyrightText": false,
"hasLegend": false,
"customTextElements": []
}
}
]

please guide me how to add dynamic text into layout. Seems like im missing very simple thing while adding dynamic text elements. (Example string )

thanks

 

0 Kudos
Kishore
Occasional Contributor

Hi Naveen,

Add the "{}" braces to the Text element name. this will provide you the custom Text Elements. Please refer to the attachment.customTextElement.PNG

 

Regards,
Kishore

View solution in original post

naveenbeti
New Contributor III

Thank you Kishore. I got it in customtextelements.

 

 

 

0 Kudos