Schnoerkel

Use for Print a DynamicMapService

Discussion created by Schnoerkel on Dec 11, 2012
Hey I use to display a map a tiledMapservice but if i print the image is terrible -> 96 dpi. Now I want to change the basemap for printing to dynamic with 300 dpi. If i take the print Parameters send by post it all works well by changing the url of the layer. In the map i make it:

var printurl = "http://kris.osnabrueck.de/dienste/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task";
var params = new esri.tasks.PrintParameters();
var printmapvar = map;
printmapvar._layers.basemap.url = "http://mydomain.de/dienste/rest/services/dynamic/MapServer";
params.map = printmapvar;   
var template = new esri.tasks.PrintTemplate();
template.exportOptions = {
       /*width: 680.31,
       height: 755.91,
       dpi: 96*/
       width: 2125.98,
       height: 2362.2,
       dpi: 300
      };
template.format = "jpg";
template.layout = "MAP_ONLY";
template.preserveScale = true;
params.template = template;
printTask = new esri.tasks.PrintTask(printurl); 
printTask.execute(params,function(value){
                                                           map._layers.basemap.url = "http://mydomain.de/dienste/rest/services/cached/MapServer";
var UrlToMapImage = value.url;
alert('success');
},function(){
       map._layers.basemap.url = "http://mydomain.de/dienste/rest/services/cached/MapServer";
alert('error');
});


Now my question is there an more effective way to get the Image of the map? I also can have custom graphics in multiple graphic layers....

Outcomes