AnsweredAssumed Answered

Print Service - Legends appear in A3 Landscape but not in other formats

Question asked by geonetadmin on Jun 3, 2014
Latest reply on Jun 26, 2014 by geonetadmin
Original User: ganeshssac

Hi Guys
I have built a printing service in my application using Print Web Map Task. My application works fine with A3 LandScape and Tabloid Landscape formats. However, when I change to to other formats such as A3 Portrait, A4 LandScape, A4 Portrait, Letter A Landscape, Letter A Portrait or Tabloid formats, it doesn't work very well. Although, first few layers on the map appears on the map, but not the
other layers.

For your reference, I have attached few samples of actual A3 Landscape & Tabloid Landscape print outs to compare with other formats (A4 Portrait and A4 Landscape). Can you anyone let me know why this is happening.

I don't think there isn't any error with code, but I wonder it may be with actual settings or should we need to resize the legends elements of the pdf documents where this legends will fit in.  I believe that legends resizes automatically in A3 Landscape and Tabloid Landscape, but not in other formats - as the legends stay bigger in size.
Is there a way we could resize the legend elements for the other formats through javascript code, If so, can anyone, help me on this.

And also, included my code below for your kind perusal.

         // get print templates from the export web map task
        var printInfo = esri.request({
          "content": { "f": "json" }
        printInfo.then(handlePrintInfo, handleError);

function handlePrintInfo(resp) {
         printTitle = dojo.byId('map_name').value;
          var legendLayer = [];
          legendLayers = dojo.forEach(_dynamicService, function(layer){
          return {
          var layoutTemplate, templateNames, mapOnlyIndex, templates;

          /*layoutTemplate = arrayUtils.filter(resp.parameters, function(param, idx) {
            return === "Layout_Template";
          layoutTemplate = dojo.filter(resp.parameters, function(param, idx) {
            return === "Layout_Template";
          if ( layoutTemplate.length == 0 ) {
            console.log("print service parameters name for templates must be \"Layout_Template\"");
          templateNames = layoutTemplate[0].choiceList;

          // remove the MAP_ONLY template then add it to the end of the list of templates 
          mapOnlyIndex = dojo.indexOf(templateNames, "MAP_ONLY");
          if ( mapOnlyIndex > -1 ) {
            var mapOnly = templateNames.splice(mapOnlyIndex, mapOnlyIndex + 1)[0];
          // create a print template for each choice
          templates =, function(ch) {
            var plate = new esri.tasks.PrintTemplate();
            plate.layout = plate.label = ch;
            plate.format = "PDF";
            plate.layoutOptions = { 
              "authorText": "Made by: KCC GIS Development Team",
        "copyrightText": " Contact GIS Team on :",
              "titleText": printTitle, 
              "scalebarUnit": "Miles" 
            return plate;

          // create the print dijit
          var printer = new esri.dijit.Print({
            "map": _map,
            "templates": templates,
            url: printUrl
          }, dojo.byId("print_temp"));
          dojo.connect(printer, "onPrintStart", function () {
                    this.templates[0].layoutOptions.titleText = dojo.byId("map_name").value;
                    this.templates[1].layoutOptions.titleText = dojo.byId("map_name").value;
                    this.templates[2].layoutOptions.titleText = dojo.byId("map_name").value;
                    this.templates[3].layoutOptions.titleText = dojo.byId("map_name").value;
                    this.templates[4].layoutOptions.titleText = dojo.byId("map_name").value;
                    this.templates[5].layoutOptions.titleText = dojo.byId("map_name").value;

        function handleError(err) {
          console.log("Something broke: ", err);