Save the stage as a jpeg

Hi there…

Does anybody knows how to save the stage as a JPG?

I need the user to click on a map; this will position a bullet on the click coordinates. Then when the users click “save changes”… this will trigger the script to save the map window as a JPG in the server!

IS THIS POSSIBLE?

Thanks…