Printout link gone in print dijit

724
1
09-27-2013 02:44 PM
MatthewLawton
Occasional Contributor
This is hopefully an easy question... I've been hacking away at the print dijit and finally have it working in my app. Along the way, I did something that caused me to lose the "Printout" link that gets generated when the printout is ready to be viewed. Instead my print button automatically opens the finished PDF as a popup. This would be fine, except I know most folks are going to have popup blockers in their browsers and I will probably get a thousand phone calls from people who can't see the printout popup because it gets blocked.

How do I get the "Printout" link back?

I've boiled my print dijit startup down to one function. Perhaps I boiled it down too much. I will paste below in case there is something that sticks out.

function startupPrinter() {
 var printDisclaimer = "DISCLAIMER";
 var printCopyright = "Contact Info";
 var printer = new esri.dijit.Print({
  map: map,
  templates: [
   {
     format: "PDF",
     label: "8.5x11",
     layout: "Letter ANSI A Landscape",
     layoutOptions: {
       authorText: printDisclaimer,
       copyrightText: printCopyright
     }
   },
   {
     format: "PDF",
     label: "11x17",
     layout: "Tabloid ANSI B Landscape",
     layoutOptions: {
       authorText: printDisclaimer,
       copyrightText: printCopyright
     }
   }
  ],
  url: "http://" + hostName + "/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
 }, dojo.dom.byId("printButton"));
 printer.startup();
};
0 Kudos
1 Reply
MatthewLawton
Occasional Contributor
I just read the fine print in the API reference:

If the URL for the Export Web Map task is from the same domain as the application the print page will be displayed in a new browser window or tab when the print button is clicked. If the URL is from a different domain, a hyperlink to the print page appears in place of the print button.

This is kind of a bummer. I would prefer the hyperlink because it seems to behave better with the popup blockers.
0 Kudos