I have an ArcGIS Javascript Map Application that uses the Print task to export the map to a PDF. I have given the users the ability to add graphics to the map, such as points or polygons, along with the ability to add a TextSymbol graphic in order to customize the PDF map output. The problem I am having is with the TextSymbol appearance on the PDF printout. For some reason I cannot change the color of the text on the output. Even if the text on the web map is red, the color of the text on the pdf is black. I have applied code to change the color of the textLayers by performing an esriRequest.setRequestPreCallback to intercept the JSON going to the Print service. However, the text still ends up black on the output. My code for that is below. I have done console.logs in order to see what the object looks like after changing the color and it does change it, but still the text ends up being black on the pdf output. Does anyone know how to either change the color of the text on the PDF output or know how to add some type of rectangle background on the TextSymbol so that the labels can be more visible on the PDF outputs?
function changeTextColor(){
esriRequest.setRequestPreCallback(function(ioArgs) {
if (ioArgs.content && ioArgs.content.Web_Map_as_JSON){
var webMapAsJson = ioArgs.content.Web_Map_as_JSON;
var webMapObj = JSON.parse(webMapAsJson);
for (var w in webMapObj.operationalLayers){
if (webMapObj.operationalLayers[w].id = "map_graphics" && webMapObj.operationalLayers[w].url == undefined){
for (var l in webMapObj.operationalLayers[w].featureCollection.layers){
if (webMapObj.operationalLayers[w].featureCollection.layers[l].layerDefinition.name == "textLayer"){
for (var f in webMapObj.operationalLayers[w].featureCollection.layers[l].featureSet.features){
//currently I am just trying to change the text to be turquoise but it keeps returning black text on pdf output
webMapObj.operationalLayers[w].featureCollection.layers[l].featureSet.features[f].symbol.color[0] = 0;
webMapObj.operationalLayers[w].featureCollection.layers[l].featureSet.features[f].symbol.color[1] = 255;
webMapObj.operationalLayers[w].featureCollection.layers[l].featureSet.features[f].symbol.color[2] = 255;
}
}
}
}
}
ioArgs.content.Web_Map_as_JSON = JSON.stringify(webMapObj);
}
return ioArgs;
});
}
symbol.setColor(new Color([0,255,255]));