AnsweredAssumed Answered

Printing with text - potential gotcha with high dpi settings

Question asked by babbot on Jan 9, 2013
Hello forum,

just a quick post to save anyone else the hassle of debugging to find this problem. It doesn't seem to be documented: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/printtemplate.htm#exportOptions

Prerequisites: Using the PrintTask, printing a map with a text symbol inside a graphics layer (N.B. currently you have to have text symbolised graphics inside a separate GraphicsLayer to your other, non-text graphics - which is a different issue entirely...)

Symptom:
When printing with preserveScale = false, text scales when printing at higher dpi. Size is correct at 72dpi. At 300dpi a 15pt text-graphic will fill the screen.

Cause:
You're sending 'height' and 'width' in the exportOptions object...

Resolution:
Set these to null for all templates which aren't 'MAP_ONLY':
        if(printTools._currentTemplate.label=="MAP_ONLY"){             printTools._currentTemplate.exportOptions = {                 "width": parseInt(printTools._widthText.value),                 "height": parseInt(printTools._heightText.value)             }         }else{             printTools._currentTemplate.exportOptions = {                 "width": null,                 "height": null             }         }


Incidentally, this is the only failure case I've found when leaving the width & height values in; everything else scales correctly. Text size is also unaffected when using preserveScale = true.

Outcomes