Example of how to use the PrintTask's customTextElements property

3814
2
Jump to solution
02-27-2013 02:03 PM
OscarShell
New Contributor II
Hello.
Can anyone share an example of how to use the PrintTask's customTextElements property?  Can I pass in a dojo textbox and it's value?
Thanks!
1 Solution

Accepted Solutions
JerrySimmons_GISP
New Contributor III
you can modify the out of the box mxd's installed with ArcGIS server (on the server they are located in C:\Program Files\ArcGIS\Server\Templates\ExportWebMapTemplates) instead of publishing you own.  Just add a text element (insert>text) then open its properties and click on the "Size and Poistion" tab and give it an Element Name (ex: infoDetails) this will be referenced in your template parameters.

In the below example I'm referencing the customTextElement infoDetails and passing in a string (details) that I generated.  This also shows you how to access multiple customTextElements.

template.layoutOptions = {
        titleText: "My Print page",
        customTextElements: [{ infoHeader: headers }, { infoDetail: details }],
    }

hope this helps.

View solution in original post

2 Replies
JerrySimmons_GISP
New Contributor III
you can modify the out of the box mxd's installed with ArcGIS server (on the server they are located in C:\Program Files\ArcGIS\Server\Templates\ExportWebMapTemplates) instead of publishing you own.  Just add a text element (insert>text) then open its properties and click on the "Size and Poistion" tab and give it an Element Name (ex: infoDetails) this will be referenced in your template parameters.

In the below example I'm referencing the customTextElement infoDetails and passing in a string (details) that I generated.  This also shows you how to access multiple customTextElements.

template.layoutOptions = {
        titleText: "My Print page",
        customTextElements: [{ infoHeader: headers }, { infoDetail: details }],
    }

hope this helps.
RobertKirkwood
Occasional Contributor III

Thanks! Worked great

0 Kudos