Hi,
I am trying to print the text symbol on the map. The textsymbol is available on the map, but when we print it as PDF it's not available. Any idea why it's happening? I am using ArcGIS JavasScript APi 3.26.
The text symbol on map.
Text symbol not available in the print pdf.
Below is the code I am using for text symbol.
var symbol = new PictureMarkerSymbol(xxxxxurl+ "Images/marker/inspection-map-markers-no-status.png", 22, 22).setOffset(0, 5);
textSymbol = new TextSymbol(stop.attributes.OBJECTID);
textSymbol.setFont(font);
textSymbol.setColor(new Color([255, 255, 255]));
textSymbol.setAlign(TextSymbol.ALIGN_MIDDLE);
textSymbol.setAngle(0);
textSymbol.setOffset(1, 0);
var newGraphic = new Graphic(stop.toJson());
newGraphic.setSymbol(symbol);
graphics.add(newGraphic);
var Graphictext = new Graphic(stop.toJson());
Graphictext.setSymbol(textSymbol);
graphics.add(Graphictext);
stop.setSymbol(textSymbol);
Thanks
Aditya Kumar
Solved! Go to Solution.
@Bishrant Sorry for delayed response. I have attached a HTML file. I have tried everything its not working.
But there is a catch in this file. If you go to line number 163 textSymbol = new TextSymbol(i++); On every click the number will change and you wont get the number in the print pdf but if the same number if you make it static textSymbol = new TextSymbol("1"); then you will get the print.
@Noah-Sager @Bishrant I finally resolved it. I have changed textSymbol = new TextSymbol(stop.attributes.OBJECTID);
to
textSymbol = new TextSymbol(stop.attributes.OBJECTID.toString());
Thanks guys for the help and time. Appreciate your support.
Aditya