AnsweredAssumed Answered

MapExtent in application not showing properly in Custom Print tool (WAB)

Question asked by esrimohan on Dec 8, 2017
Latest reply on Dec 12, 2017 by esrimohan



Below is the code I am using it for Print the Map . The code works fine and  got the output as PDF file in separate window.  

But the issue is map extent in the application and map extent in PDF output are not matching exactly. "Image1" is from WAB application and "Image2" is from PDF out put . Kindly refer the attached Image for reference. 


var url = "https://servername/gis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task";
var printTask = new PrintTask(url);
var params = new PrintParameters();
var template = new PrintTemplate();
template.format = "PDF";
template.layout = "MAP_ONLY";
template.layoutOptions = {"legendLayers": [legendLayers],
"titleText": "Map Print",
"authorText": "AAAAAAAA",
"copyrightText": "BBBBBBBB",
"scalebarUnit": "Kilometers"}; =;
params.template = template;
printTask.on("error",lang.hitch(this, this._printResultError));
printTask.execute(params, lang.hitch(this, this._printResult));


_printResult:function(res){, "_blank")