Select to view content in your preferred language

Can I create an image from JavaScript API to add to a PowerPoint or Word Doc?

6289
29
12-07-2015 07:53 AM
JimSirianni
New Contributor

What I need to accomplish is to generate a map (client side) and highlight the county or zip code based upon geo locations that I have.

I also need to take that same map and generate an image that I can add to either a word or power point document.

Can this be done with ArcGIS?

I have tried with Bing and Google Maps and I am unable to create static images due to the url length.

0 Kudos
29 Replies
ChrisSmith7
Frequent Contributor

Jim,

In addition to Robert's suggestion, you can scrape the HTML from the map and launch a print window from the browser. In Chrome, I can send the printout to MS OneNote. In our mapping app, we allow the user to "export" an image/PDF using the ArcGIS print service, or, we allow the user to "print" using the HTML scrape.

0 Kudos
JimSirianni
New Contributor

How did you accomplish this with a screen scrape?  There isn't a said image (tag) to scrape off the page.

0 Kudos
ChrisSmith7
Frequent Contributor

I simply create a blank HTML page from text in js. Inside of the page, insert the map content, which, in my case, is just the innerHTML of the document - document.documentElement.innerHTML (I pipe-in maps over an iframe, so I just grab the whole page).

You can then just open a print dialog and write the HTML, and voila, a scrape of the map.

0 Kudos
JimSirianni
New Contributor

So you are just scrapping the div container and everything that is in it?  Also is this approach valid?  I was trying to go down this route for Google Maps but was told it could be in violation of the terms of service.

0 Kudos
ChrisSmith7
Frequent Contributor

If you're licensed for the product, there shouldn't be any issue with doing this - you're just printing the page. You may want to have a look at this:

Is the ArcGIS Server JavaScript API free to use? - Geographic Information Systems Stack Exchange

0 Kudos
JimSirianni
New Contributor

So you were able to just grab the parent map div and scrape to an image?

0 Kudos
ChrisSmith7
Frequent Contributor

It's not an image - it would be a printout from the browser using a scape of the map's HTML - the browser might support saving as an image though. For instance, in Chrome, I can send the printout as an image to MS OneNote.

0 Kudos
SteveCole
Frequent Contributor

..or just Print Screen?....

0 Kudos
ChrisSmith7
Frequent Contributor

That would get my vote, unless they need functionality for users on the system.

0 Kudos
JimSirianni
New Contributor

Not an option.  They have to be able to click a button and have that map image added to a document.

0 Kudos