All from the client?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
Sorry, no example, but some hints on how to make high quality prints from the client with dynamic server layers. I haven't done this in JSAPI, but I've used similar techniques in Web ADF and silverlight.
The problem with client side printing is that you will only get screen resolution in your printouts unless you request a map image with higher DPI. When using dynamic layers this is possible.
The trick is to keep track of the current extent, size of map control, layer definitions and visible layers and request the same map image with a higher DPI setting. Stuff that image into an img tag with a defined size and print using your browser.
Request the map using REST or maybe the exportMapImage method of the ArcGISDynamicMapLayer can be used. Create an img tag on a new page, optionally with some headers and text, with height and width same as the map if you want to print the same extent. Set the image source to your map image, which will contain a lot more pixels than the size of the img tag and thus when printing will generate a high quality print with a defined scale.
If you have several layers and graphics, this approach soon becomes very nasty.