I clear attributes and info templates before printing and reset them after.Because graphics are objects you can set all the properties you want.var graphic = new esri.Graphic(evt, app.anno.sym.point);
var gId = new Date().getTime().toString();
var atts = { id: gId };
graphic.setAttributes(atts);
var it = new esri.InfoTemplate();
it.setTitle('Point');
it.setContent(app.anno.itContentPoint(gId));
graphic.setInfoTemplate(it);
graphic.graphic_id = gId;
graphic.graphic_atts = atts;
graphic.graphic_it = it;
graphic.graphic_text = false;
app.map._layers.gl_anno_point.add(graphic)
When creating a graphic set the esri attributes and info template as normal but also set them as unique properties on the graphic object. This concept is extremely useful for more than graphics. I set custom properties on layers, the map, etc to accomplish a variety functionalities.graphicsClear: function () {
dojo.forEach(app.map._layers.gl_anno_polygon.graphics, function (g) {
g.setInfoTemplate(null);
g.setAttributes(null);
});
dojo.forEach(app.map._layers.gl_anno_polyline.graphics, function (g) {
g.setInfoTemplate(null);
g.setAttributes(null);
});
dojo.forEach(app.map._layers.gl_anno_point.graphics, function (g) {
g.setInfoTemplate(null);
g.setAttributes(null);
});
dojo.forEach(app.map._layers.gl_anno_marker.graphics, function (g) {
g.setInfoTemplate(null);
g.setAttributes(null);
});
dojo.forEach(app.map._layers.gl_anno_text.graphics, function (g) {
g.setInfoTemplate(null);
g.setAttributes(null);
});
},
graphicsReset: function () {
dojo.forEach(app.map._layers.gl_anno_polygon.graphics, function (g) {
g.setInfoTemplate(g.graphic_it);
g.setAttributes(g.graphic_atts);
});
dojo.forEach(app.map._layers.gl_anno_polyline.graphics, function (g) {
g.setInfoTemplate(g.graphic_it);
g.setAttributes(g.graphic_atts);
});
dojo.forEach(app.map._layers.gl_anno_point.graphics, function (g) {
g.setInfoTemplate(g.graphic_it);
g.setAttributes(g.graphic_atts);
});
dojo.forEach(app.map._layers.gl_anno_marker.graphics, function (g) {
g.setInfoTemplate(g.graphic_it);
g.setAttributes(g.graphic_atts);
});
dojo.forEach(app.map._layers.gl_anno_text.graphics, function (g) {
g.setInfoTemplate(g.graphic_it);
g.setAttributes(g.graphic_atts);
});
}
Clear the esri attribute and info template properties before executing the print task. Then reset them at the end of the print task callback function.This takes care of the text symbol print issue, but more important it is reducing the size of the request to the server for the print task. Sending the info template of any graphic, especially one with a custom widget, exponentially increases the request size, and for what?The other option is a custom print task. The problem there is you still need to clear attributes and info templates from the objects you are creating with the print task before creating the json. Six of one, half dozen of the other.