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:
- Page template (already available via
esri.dijit.print
) - Map Title
- 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:
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();
}