AnsweredAssumed Answered

Print Task Legend

Question asked by vikrant327 on Jul 3, 2012
Latest reply on Jul 5, 2012 by vikrant327
I have a secured map service and I tried to print the map with legend . Everything works except legend is not showing up in the print layer. Below is the code as how I am setting up the print button. Its same as given in one of the sample.

var layouts = [
            "name": "Letter ANSI A Landscape",
            "label": "Landscape (PDF)",
            "format": "pdf",
            "options": {
              "legendLayers": [0,1,2,3], // empty array means no legend
              "scaleBarUnit": "Miles",
          }, {
            "name": "Letter ANSI A Portrait",
            "label": "Portrait (Image)",
            "format": "pdf",
            "options":  {
              "legendLayers": [0,1,2,3],
              "scaleBarUnit": "Miles",
              "titleText": $("#title").val()
        // create the print templates, could also use
        var templates = [];
        dojo.forEach(layouts, function(lo) {
          var t = new esri.tasks.PrintTemplate();
          t.layout =;
          t.label = lo.label;
          t.format = lo.format;
          t.layoutOptions = lo.options
        app.printer = new esri.dijit.Print({
    "templates": templates,
          url: "" + response
        }, dojo.byId("print_Button"));