mcdade31

Can I show the legend on a printout if using AGSJS TOC Widget? Print Questions.

Discussion created by mcdade31 on Mar 15, 2013
Latest reply on Mar 15, 2013 by JGravois-esristaff
A few print related questions:

1. Is it possible to show the legend on a printout if I'm using the AGSJS TOC widget? Setting legendLayers doesn't seem to work, which I assume is because I'm not using it anywhere else in my app.

2. Is it possible to remove the credits from the printout? I'm using v3.2. The template mxd doesn't reference them.

3. Finally, How do I capture the same extent of my map in my printout? It looks like the map is displaying at the same extent, but the print area is smaller than my screen, so that may be the issue. How can I get the print to look exactly like the screen? I've tried preserveScale at both true and false and the result is the same.


Code:
dojo.require("esri.dijit.Print");

function initPrinter() {

 var printTemplates = [{
  label: "Map Only",
  format: "png32",
  layout: "MAP_ONLY",
  exportOptions: {
    width: map.width,
    height: map.height,
    dpi: 96
  }
   }, {
  label: "Portrait",
  format: "PDF",
  layout: "Letter ANSI A Portrait",
  layoutOptions: {
    titleText: "my layout",
    authorText: "GIS Team",
    copyrightText: "Copyright 2013",
    scalebarUnit: "Miles"
  }
  }, {
  label: "Landscape",
  format: "PDF",
  layout: "Letter ANSI A Landscape",
  layoutOptions: {
   titleText: "my layout",
   authorText: GIS Team",
   copyrightText: "Copyright 2013",
   scalebarUnit: "Miles"
   }
   }];

 // print dijit
 var printer = new esri.dijit.Print({
  map: map,
  templates: printTemplates,
  url: "path/to/my/Export%20Web%20Map%20Task"
  }, dojo.byId("printButtonDiv"));   
 
 printer.startup();
  
}

Outcomes