The issue is that the text will not print in my print layout that I have configured. If the user adds in text to the map, they can change the color, size and angle. However, when pringing out the map using the print widget, none these settings carry over to the print layout. By default, the text shows up in black.
var font = new Font("40pt", Font.STYLE_ITALIC, Font.VARIANT_NORMAL, Font.WEIGHT_BOLD, "Courier New");
Hi Ian,I think the issue you are facing here is a known software limitation. It is necessary to supply all of the font properties when creating a new Font object.[#NIM099497 The printing service only honors the font properties of textSymbols if all or none of the new Font object parameters are defined.]Try something like this in your code, and see if the customization appears in the printout (please note that this is in AMD style):var font = new Font("40pt", Font.STYLE_ITALIC, Font.VARIANT_NORMAL, Font.WEIGHT_BOLD, "Courier New"); Hope this helps!-Noah
//add a text symbol to the map listing the location of the matched address. var displayText = candidate.address; var font = new esri.symbol.Font("12pt",esri.symbol.Font.STYLE_NORMAL, esri.symbol.Font.VARIANT_NORMAL,esri.symbol.Font.WEIGHT_BOLD,"Helvetica"); var textSymbol = new esri.symbol.TextSymbol(displayText,font,new dojo.Color("#FF0000")); textSymbol.setOffset(0,12); map.graphics.add(new esri.Graphic(geom, textSymbol)); return false; //break out of loop after one candidate with score greater than 80 is found.
var font = new esri.symbol.Font("12pt",esri.symbol.Font.STYLE_NORMAL, esri.symbol.Font.VARIANT_NORMAL,esri.symbol.Font.WEIGHT_BOLD,"Helvetica");
Hi Ian,I tested with your font code, and it prints just fine for me. I only used the one line of code though.var font = new esri.symbol.Font("12pt",esri.symbol.Font.STYLE_NORMAL, esri.symbol.Font.VARIANT_NORMAL,esri.symbol.Font.WEIGHT_BOLD,"Helvetica");There may be two other issues going on:1) are you using a proxy in your application? I highly recommend our new resource proxythe length of the print request may be getting truncated, and the proxy will help with this2) for the colors, try using RGB values (e.g. 255, 0, 0) instead of hexadecimal (e.g. #FF0000), and see if that helps-Noah
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.