Just wanted to confirm I was on the right track...
I copied the Print With Templates sample to my PC and ran it, and the Print button did not appear. However, when I instantatiate a new print dijit in my code, without inserting any of that template code, it prints out a PNG image into a new window just fine, using the ESRI server's print utility at http://utility.arcgisonline.com/ (and with hosting API locally)
var PrintWidget = new esri.dijit.Print({
map: map,
url: getWebData.ArcGISCOMPrintService
}, dojo.byId("PrintDiv"));
PrintWidget.startup();
PrintWidget.show();
I recall seeing in the proxy docs regarding CORS that while javascript doesn't allow things across domains there is an exception for images. Is that perhaps why printing of the map as a PNG works with the ArcGISonline utility, even though we're hosting the 3.3 API locally? I'd like to use the templates to print to PDF and include the legend, scalebar and title text. Thanks for any and all input!
Yes, you need proxy. Please see details here: http://forums.arcgis.com/threads/77128-Export-Web-Map-Task-Error-unable-to-connect-to-map-server-onl... First of all, it doesn't matter where you host the JS API. What matters is where you host your web application and your print service. If both are under the same domain, proxy page is not necessary. If they are different, then it requires proxy. As simple as that.
Hello, maybe this could be another thread, but i think its relevant to this one...
We have our proxy page on a cloud server (which has ArcServer 10.1), and our web application on a development server (w/ ArcServer 10.0). We are using JS API 3.1, hosted locally on the same development server. I am trying to use the Print class, based on this example: https://developers.arcgis.com/en/javascript/jssamples/widget_print.html.
If I add 'esri.config' to my app as an required module (as in the example), I get an error saying: " ...esri/config.js Not Found". When I remove this line, I get an error saying "Print is not defined" and another, "403: Forbidden"...in Firebug, the URL I see along with the error is the proxy page URL, with the web host server name appended to it...
What am I doing wrong here? I hope I am being clear. Thanks, J