Is it possible to use customTextElements with the esri/widgets/Print ?
Thanks
Vicki
Vicki,
There are a number of thread on this. Here is the one I think you need to concentrate on.
What I trying to do is use the esri/widgets/print in 4.10 with the a esri/tasks/support/PrintTemplate so I can use the layoutOption and CustomTextElements.
new esri.widgets.print({
view: view,
templateOptions: {
title: "Buncombe County, NC",
author: "Buncombe County",
copyright: "Buncombe County",
legendEnabled: false,
layoutOptions:
{
customTextElements: [{
"info": "1234"
}
]
}
},
// specify your own print service
printServiceUrl: "https://--/arcgis/rest/services/ExportWebMap_VT/GPServer/Export%20Web%20Map"
}),
Yes the 4.x API supports layoutOptions and customTextElements:
layoutOptions: {
titleText: "My Print",
authorText: "Sam",
copyrightText: "My Company",
scalebarUnit: "Miles",
// the following text elements must
// exist in your print service
customTextElements: [{
"description": "My description",
"location": "My Location"
}]
}
I am using that code but it's still not working
widgetPrint = new Expand({
content: new Print({
printTemplate: PrintTemplate,
view: view,
templateOptions: {
title: "Buncombe County, NC",
author: "Buncombe County",
copyright: "Buncombe County",
legendEnabled: false
},
layoutOptions: {
titleText: "My Print",
authorText: "Sam",
copyrightText: "My Company",
scalebarUnit: "Miles",
// the following text elements must
// exist in your print service
customTextElements: [{
"info": "My description"
}]
},
// specify your own print service
printServiceUrl: "https://--/arcgis/rest/services/ExportWebMap_VT/GPServer/Export%20Web%20Map"
}),
view: view,
expandTooltip: "print map",
group: "top-left"
});
Vicki,
Sorry to have misguided you on this. The print widget does not have a PrintTemplate so you can not set the PrintTemplate.layoutOptions. As far as I know, to use customTextElements then you have to use the PrintTask and PrintTemplate, not the PrintWidget.