app.printer = new esri.dijit.Print({ map: app.map, url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task" }, dojo.byId("printButton")); app.printer.startup();
I think you can use Print utility from ArcGIS Server 10.1 which has the capability to return the following Formats:
[ PDF, PNG32, PNG8, JPG, GIF, EPS, SVG, SVGZ ]
We have a Print Widget in JS API to use the capability of Print Utility from ArcGIS Server 10.1.
Code snippet:
app.printer = new esri.dijit.Print({ map: app.map, url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task" }, dojo.byId("printButton")); app.printer.startup();
Hereis the link to the sample which adds graphics and gets the resultant image in PNG32 format(You can change it to JPG).
Printclass documentation.