3

I have a requirement to be able to produce a pdf of the application's map (Esri JS API 3.7). The map will contain ArcGISDynamicMapServiceLayers, user drawn graphics including text symbols, and possibly a pop-up.

The PrintTask made available at ArcGIS Server 10.1 gets be about 80% of the way there. However, it does not handle text symbols or popups as far as I can tell. If it were just the text symbols I had to worry about, I think I would just hack together something with the arcpy mapping module to do the job. But the popup is much more challenging

I've explored things like BrowserShots, wkhtmltoimage...etc and like with no luck. I'm wondering if anyone has been able to accomplish something similar.

2

You can do a lot with arcpy. You should be able to handle text symbols (labels). Check out some of the advanced printing tutorials. Something like a popup might be challenging. I don't think a screen shot approach could work because you never know the screen resolution of client device and how that might fit into whatever fixed size you are trying to I use. Printing maps has always been a pain point, but for what it's worth, arcpy offers options, the learning curve is just steep.

1

Looking through some other posts, I feel like you'll be more successful extending the print task on the server a la arcpy.mapping

Some of the other posts I saw:

https://stackoverflow.com/questions/12261423/how-to-capture-html-page-as-an-image-using-javascript-jquery-html5-function?rq=1

https://stackoverflow.com/questions/60455/take-a-screenshot-of-a-webpage-with-javascript

These don't exactly address the issue, but show a general lack of screen capture ability in javascript. I used to do it all the time on the flash side, but would also love to know in javascript.

0

alt+PrntScr then open up paint and hitctrl+v

edit: not trying to be snide, that's probably your best bet, JavaScript doesn't have any easy screenshot abilities for security reasons so any solution is going to involve using a different program to grab the screen.

  • 1
    Somehow I think OP was looking for something a bit more elegant and programmable, since he mentioned pure JS... – Paul Oct 3 '13 at 5:02
  • 2
    I somewhat doubt he was going for elegant else he wouldn't be using ArcGIS. But seriously folks you can't get a screenshot with JavaScript. – Calvin Oct 5 '13 at 2:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.