Solved! Go to Solution.
Can this known limitation of the Flex Viewer be added to the help documentation so that future users won't waste hours trying to find this simple answer?
I found a solution to this bug on another site. The scale bar was not correct when printing from an application in Web Mercator. You need to adapt the Print.js file of the print widget and change the following line:
this.printparams.outSpatialReference = this.map.spatialReference;
into something like:
this.printparams.outSpatialReference = new SpatialReference(32631);
32631 has to be changed to a Spatial Reference WKID of your region. My MXD templates used by the print service are having the same reference system.
And of course, you have to
define(["esri/SpatialReference" ...], function (spatialReference...
in the beginning of the Print.js file (the order of elements in the define-part has to be the same as in the function-part)
No idea why ESRI commented out the following line in the print.js code.
//fix issue #7141
// this.printparams.outSpatialReference = this.map.spatialReference;