Select to view content in your preferred language

Add custom text element to print layout in print widget

6878
4
Jump to solution
01-10-2021 06:21 AM
Labels (1)
MHasan
by
Emerging Contributor

Hello everyone.

I have been trying to create a printing service from tools published from ArcGIS Pro using the following tutorial:

Share custom layouts for printing from ArcGIS Pro—ArcGIS Server | Documentation for ArcGIS Enterpris...

I want to add a custom text element and let the user enter the text value in the print widget.

The tutorial indicates that :

"If you want to insert a custom text element, add a text element and embed the element's name in a set of open and closed curly braces, such as {parcel-id}."

But it doesn't tell how and where to embed the element name.

 

0 Kudos
1 Solution

Accepted Solutions
LongDinh
Frequent Contributor

Hi MHasan,

I was also perplexed by this vague description as well. Luckily I found the solution by looking at the default installation templates.

The name of the element is the Table of Contents when in Layout mode. Adding a open and closed curly bracket will add the element to the Print Layout Template JSON's "customTextElements" array.

Below is a screen capture of the "Get Layout Templates Info" which has successfully added the "{VeryCustomElementName}" dynamic element to the print template

LongDinh_0-1613970623211.png

 

View solution in original post

4 Replies
LongDinh
Frequent Contributor

Hi MHasan,

I was also perplexed by this vague description as well. Luckily I found the solution by looking at the default installation templates.

The name of the element is the Table of Contents when in Layout mode. Adding a open and closed curly bracket will add the element to the Print Layout Template JSON's "customTextElements" array.

Below is a screen capture of the "Get Layout Templates Info" which has successfully added the "{VeryCustomElementName}" dynamic element to the print template

LongDinh_0-1613970623211.png

 

MHasan
by
Emerging Contributor

Thank you very much @LongDinh 

It's really easy but it wasn't obvious from the documentation.

0 Kudos
BugPie
by
Frequent Contributor

The screen shot was the winning piece. Thanks for sharing that visual aid. Man, I've been stuck on this one... no more! 

DavidlMason
Occasional Contributor

That was very simple, thanks.

Now is there a simple way to add a legend also? I tried the curly brackets around that, but that would've been too easy.

0 Kudos