Print Widget and Browser Print... Dialog

576
2
11-03-2017 04:22 PM
GregoryJohnson1
New Contributor

Good afternoon, 

Is there some way to auto-generate the browser's Print... dialog, either in place of the Printout hyperlink or as part of it after being clicked? The following code is in place and working:

// print dijit

esriConfig.defaults.io.proxyUrl = "http://gistest1/DotNet/proxy.ashx";
esriConfig.defaults.io.alwaysUseProxy = false;

printer = new Print({
map: map,
url: "http://gistest1:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
}, dom.byId("printButton"));
printer.startup();

Source reference:

Print | ArcGIS API for JavaScript 3.22 

Thank you,

Greg

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Greg,

   Because the print output is produced server side and the returned value is just a link this will not be easy. The browsers print preview is for showing a html content print preview of what will be sent to the printer. So in your situation you would have to create a div in the apps main body and add the url of the print widgets result as an image (if you are requesting a pdf then you are out of luck) and then send that div to the browsers print method (this is simple explanation and would involve a lot more detail in truth).

GregoryJohnson1
New Contributor

OK, thank you for the reply. G

0 Kudos