Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to create an option in my web application where a user can click on a print button and a list of options appears:

  1. Page template (already available via esri.dijit.print)
  2. Map Title
  3. Notes or Custom Text

No. 1 is known to be available but I can't find any good resource on how to be able to dynamically change these inputs. Any ideas?

Code I'm working with:


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"));            


share|improve this question
may be helpful for you… – Sunil Mar 15 '13 at 16:14
I have print set up without any issues. My question is whether I can pass the parameters to the end user so they can define map template, map title and custom text vs me setting those via code. – Craig Mar 15 '13 at 16:28
up vote 5 down vote accepted

Using this sample...

Instead of calling the request for printInfo and then handlePrintInfo on startup. Create some entry areas in your html where a user can enter values and a submit button. Setup an event handler for the onclick event of button.

After the onclick, then you call the handlePrintInfo and use the entry area values when you create the template. If you want, you could still get printInfo on startup, just save it to a variable outside init() so that it's ready for you.

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

function handlePrintInfo(resp) {...
share|improve this answer
thanks. I'll give a try at this. I've attached my print.js code, its a bit different from the sample you linked to but I'm sure the idea is the same. – Craig Mar 15 '13 at 20:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.