function createPrintDijit(printTitle) { var map = getMap(); var layoutTemplate, templateNames, mapOnlyIndex, templates; // create an array of objects that will be used to create print templates var layouts = [ { "name": "print_layout_cadrin_letter_us", "label": "8.5x11 portrait (PDF)", "format": "pdf", "options": { "legendLayers": [], // empty array means no legend "titleText": "" } }]; // create the print templates, could also use dojo.map var templates = []; dojo.forEach(layouts, function(lo) { var t = new esri.tasks.PrintTemplate(); t.layout = lo.name; t.label = lo.label; t.format = lo.format; t.layoutOptions = lo.options; templates.push(t); }); printer = new esri.dijit.Print({ "map": map, "templates": templates, url : "http://"+cartotest+"/arcgis/rest/services/ExportWebMap/GPServer/Export%20Web%20Map" }, dojo.byId("print_button")); printer.startup(); printer.on('print-complete',function(evt){ console.log('Job completed'); // Here you can try to edit the hyperlink or add a new action with jQuery }); printer.on('error',function(){ console.log('PRINT TIME-OUT ERROR'); }); printer.on('print-start',function(){ console.log('The job is starting.'); }); }
Hi David,
Did you ever figure how to get the output url? I'm trying to avoid taking on the print task if possible, as the print dijit basically gets me where I need except for this detail..