<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Export the map to an image, client-side, for printing? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688063#M64037</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Everything is done client-side, so the only requirement is a modern web browser.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Oct 2015 17:04:48 GMT</pubDate>
    <dc:creator>JeffJacobson</dc:creator>
    <dc:date>2015-10-02T17:04:48Z</dc:date>
    <item>
      <title>Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688048#M64022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm guessing the answer is still no and I'm guessing it is still not planned.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a requirement to output an image of the final map for the user to save. The map has a tile base with overlays of contour lines generated by our application. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As the application will be run deployed (server and client on a laptop) we don't want to have to build/maintain an ArcGIS 10.1 box just for the purpose of allowing the print service (our tiles are static on our web server). Simple cannot justify it on cost alone.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A simple way to simply output a JPEG/PNG of what the map is showing would be great. A "native" to ESRI JS API "screenshot" is all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any plans? Any real reason why not?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's a little frustrating. "Get away from native desktop apps., go Web 2.0" they said. So we started using Flex/Flash which can do these sort of things clientside. "Get away from Flash/Flex, move to HTML5, it's the future" they said. Now look, we are trying to do desktop type work on a web type app. Can you explain this to your managers, nope. :mad:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 13:48:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688048#M64022</guid>
      <dc:creator>IanWatkins</dc:creator>
      <dc:date>2013-06-20T13:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688049#M64023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, Hope I am OK to resurrect this topic. I thought it would be better than starting a new thread on the same topic. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Just wondering if anyone has made progress with this? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am currently trying to do pretty much the same thing, grab an image of the map (including graphics) to use elsewhere in my application. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I too don't have access to a server side print service/export web map task and have been trying to do this client side. Or as client side as possible. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I did have access to an ArcGIS server instance it would be at version 10.0 for the time being. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have made some progress using the html2canvas library to create a html5 canvas element from the map div. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This gives me a 'picture' of the basemap but does not handle any user defined graphics (SVG). I can however separately create an image of the graphics and add this image onto the canvas, being careful to make sure they line up properly. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I then create a smaller copy of the canvas and finally generate a new image from this canvas to add to a new div elsewhere on the page. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The user then has the option to save/print this smaller picture of the map to pdf (using a server side pdf generator).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This all seems to work OK, unless the canvas has been 'tainted' by cross domain content. Which in my case, it will always have been because the basemap service is hosted on a different domain to the application itself. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;html2canvas on GitHub offers a php proxy to handle this situation but this appears to store a copy of all the map tiles in the application web server, effectively building up a second cache of map tiles copied from the basemap service. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not really what I want.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone suggest a better method or is the canvas element the only option if the print task/service route is not available? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Richard&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 18:25:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688049#M64023</guid>
      <dc:creator>RichardBetts</dc:creator>
      <dc:date>2014-01-30T18:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688050#M64024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;At the moment, it still has to be serverside.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I ventured down the html5 canvas path as well, but i still support ie7/8, so its out&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Flash/Flex out for many many reasons, not limited to security, update-ability, avoiding plugins, "a future", etc..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does the ESRI api need a map.toImage() method that renders tiles/dynamic/graphics accurately? absolutely.&amp;nbsp; Are we there yet? Not even close&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 19:33:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688050#M64024</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2014-01-30T19:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688051#M64025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you can see everything in the map, why it has to go through a proxy to get other things? And img tags from the tiled map service are not contrained by cross-domain policy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi, Hope I am OK to resurrect this topic. I thought it would be better than starting a new thread on the same topic. &lt;BR /&gt;Just wondering if anyone has made progress with this? &lt;BR /&gt;&lt;BR /&gt;I am currently trying to do pretty much the same thing, grab an image of the map (including graphics) to use elsewhere in my application. &lt;BR /&gt;I too don't have access to a server side print service/export web map task and have been trying to do this client side. Or as client side as possible. &lt;BR /&gt;If I did have access to an ArcGIS server instance it would be at version 10.0 for the time being. &lt;BR /&gt;&lt;BR /&gt;I have made some progress using the html2canvas library to create a html5 canvas element from the map div. &lt;BR /&gt;This gives me a 'picture' of the basemap but does not handle any user defined graphics (SVG). I can however separately create an image of the graphics and add this image onto the canvas, being careful to make sure they line up properly. &lt;BR /&gt;I then create a smaller copy of the canvas and finally generate a new image from this canvas to add to a new div elsewhere on the page. &lt;BR /&gt;The user then has the option to save/print this smaller picture of the map to pdf (using a server side pdf generator).&lt;BR /&gt;&lt;BR /&gt;This all seems to work OK, unless the canvas has been 'tainted' by cross domain content. Which in my case, it will always have been because the basemap service is hosted on a different domain to the application itself. &lt;BR /&gt;html2canvas on GitHub offers a php proxy to handle this situation but this appears to store a copy of all the map tiles in the application web server, effectively building up a second cache of map tiles copied from the basemap service. &lt;BR /&gt;Not really what I want.&lt;BR /&gt;&lt;BR /&gt;Can anyone suggest a better method or is the canvas element the only option if the print task/service route is not available? &lt;BR /&gt; &lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Richard&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 20:33:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688051#M64025</guid>
      <dc:creator>JianHuang</dc:creator>
      <dc:date>2014-01-30T20:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688052#M64026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the replies. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jian - I am more of a GIS person than a web person, but here's how I understand it...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I don't use a proxy to read the basemap tiles onto the new canvas, the canvas is considered to be tainted and I will be unable to use the toDataURL() method to create an image data URL which I then intend to use as the source of an img element. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need the img element because a canvas will never appear on my pdf, tainted or not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In other words - 'If the canvas has been tainted, you can no longer pull data back out of the canvas'. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using html2canvas with the proxy very nearly gives me what I need, other than this issue of the map tiles being physically copied to my web server. I guess I assumed the proxy would work in the same way as it does for wms capabilities requests, as a 'middleman' to make the responses appear to be from the same domain.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff -Totally agree. Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 18:32:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688052#M64026</guid>
      <dc:creator>RichardBetts</dc:creator>
      <dc:date>2014-01-31T18:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688053#M64027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Rich,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm doing something similar and I talked to a couple folks around the office and they suggested using a Scheduled Task a few times a day on the server to delete the local cache of images that are generated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2014 20:27:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688053#M64027</guid>
      <dc:creator>PhilReese1</dc:creator>
      <dc:date>2014-03-14T20:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688054#M64028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you show me a sample you use for printing ?&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2014 17:36:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688054#M64028</guid>
      <dc:creator>MayJeff</dc:creator>
      <dc:date>2014-09-20T17:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688055#M64029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;old thread resurrection time!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on making a Screenshot widget in WebApp Builder using html2canvas.&amp;nbsp; I will post this thread in WAB Widgets forum soon but thought to post here first as you all have experience with html2canvas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a working demo of a page that creates a screenshot and opens the standard Save As... browser dialogue here - &lt;A href="https://github.com/kevinsagis/ScreenshotDemo" title="https://github.com/kevinsagis/ScreenshotDemo"&gt;kevinsagis/ScreenshotDemo · GitHub&lt;/A&gt;&amp;nbsp; this is everything all in one HTML file. Just open it localhost or a IDE like Visual Studio. (note this is a repost of a js Fiddle because it does not work on js Fiddle for some reason, all credit for all authors in comments and Read Me)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also have the work in progress widget where I am porting this code into WAB, here.&amp;nbsp; &lt;A href="https://github.com/kevinsagis/Screenshot-Widget" title="https://github.com/kevinsagis/Screenshot-Widget"&gt;kevinsagis/Screenshot-Widget · GitHub&lt;/A&gt; .&amp;nbsp;&amp;nbsp; This not only runs the DOM through html2canvas, it then converts it into a "blob" (not sure really what this is... ?? .. but hey it works) then makes the browser open a "Save As.." dialogue for the DOM element as a .PNG image file.&amp;nbsp; So I intend to grab the whole viewport, via the DOM "main-page" or "map" node in WAB. Would like main-page so as to grab widgets, attrib table. Users want a "print screen" button. This is the closest we can get of course with Javascript, considering browser security limitations. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when I ported the code into WAB,&amp;nbsp; pointed it to main-page and said &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var windowScreenShot = dom.byId("main-page");&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; html2canvas((windowScreenShot), {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onrendered: function (canvas) {&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; theCanvas = canvas;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.open("", canvas);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It only generates a blank page in a new window.&amp;nbsp; So I tried smaller DOM nodes like buttons, still no go. In the console it just shows &amp;lt;canvas width="142" height="45"&amp;gt;&amp;lt;/canvas&amp;gt; when I log 'canvas'.&amp;nbsp; And opens a blank window.&amp;nbsp; I removed the toBlob and SaveAs because even the html2canvas isn't working yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideas anyone? Scoping? Something else?&amp;nbsp; I have seen in misc. threads that complex DOM sometimes creates issues for html2canvas although I would think WAB would be fine. And cross domain can be an issue. Maybe I need a proxy or something? But since it is local on node.js I thought that would not be it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 13:28:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688055#M64029</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-05-22T13:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688056#M64030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We do all of our page building client side (including pdf generation) but still use server side operations to generate the map.&amp;nbsp; A couple reasons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We still support older IE, which uses vml, so we cant go pure canvas.&lt;/P&gt;&lt;P&gt;We support non ESRI basemaps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;www.mymanatee.org/gisapps/mobile/index.html&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Printing is on the tools tab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 20:19:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688056#M64030</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2015-05-22T20:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688057#M64031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to do the same thing - get a "screenshot" of my mapDiv.&amp;nbsp; I have been messing around with html2canvas as well and I can successfully get a basemap image and graphics image but am not sure how to "layer" the graphics image over the basemap image.&amp;nbsp; Here is the code I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$("btnSave").click(function(){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; html2canvas($("#mapDiv"), {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "useCors": true, //to get basemap&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onrenderer: function(canvas1) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; theCanvas = canvas1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //convert and download as image&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Canvas2Image.saveAsPNG(canvas1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; html2canvas($("#mapDiv"), {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "useCors": false, //to get overlying graphics&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onrenderer: function(canvas2) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; theCanvas = canvas2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //convert and download as image&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Canvas2Image.saveAsPNG(canvas2);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure how to now put canvas2 on top of canvas1 and create a new image.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 16:11:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688057#M64031</guid>
      <dc:creator>PamBond</dc:creator>
      <dc:date>2015-10-01T16:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688058#M64032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just stumbled across this post, and it's interesting to see people are still talking about this two- years -old topic. and it's also surprised me that we still don't have a very good solution in JavaScript API for ArcGIS ( according to what people said here)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are lots of benefits to have a screenshot of the current map on the screen programmatically, one of them is efficiency.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In one of my Flex projects, when generating a report in a "classic and proper" way -&amp;nbsp; from server side using python of course -- it took up to 3 minutes! and that was in the testing environment and no concurrent requests at all. of course, hundreds of layers in my map was to blame... then I scraped the "classic" way and took a shortcut by generating the report on the client side, then I trimmed the report generating time to seconds. the map quality in the report? not too bad. Furthermore, using the unique Flash feature, I could even put some sequence numbers on the selected map features (so that the items in the list can be referred back to the map) in one Frame, and took a snapshot, then restore the map in the next Frame... Yes, flex running in flash player frame after frame like playing a video...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://mapiq.dfc.sa.gov.au/"&gt;http://mapiq.dfc.sa.gov.au&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do a proximity search and view report, then you know what I mean. This function was built about 4 years ago.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'v done the transition from flex to JavaScript, I have built some apps using JavaScript API for ArcGIS, but my personal view is Flex was more elegant than JavaScript as a programming language... not only in the ability it allows you to create a bitmap clipping and copying the map area on the screen, but in the simplicity and elegancy as an advanced language whole. well, although I have this reflection, but don't get me wrong, I am sober:&amp;nbsp; the trend has been set: HTML5 and JavaScript are the future, like it or not, we have to embrace it. Just hope we'll get the cool stuff we had in Flex in JS soon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for reading this post and sorry it did not provide a solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2015 01:49:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688058#M64032</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2015-10-02T01:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688059#M64033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Coming form the Flex world myself I remember how easy it was to get a bitmap of the map and use it in my custom client side reporting. I have asked a couple of the JS API development team about this and found that this ability does not exist currently but with 4.x of the API it will be more like to a possibility. Currently I use the PrintTask to print a JPG of the map and then use that JPG in the report that I am generating clientside. The advanced report generation that I had in Flex was actually pretty easy to migrate to JS once I figured out how to get the maps image.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2015 02:51:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688059#M64033</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-10-02T02:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688060#M64034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Robert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sounds promising. I will do more research on this when I need to migrate the stuff I did into JS or in some other projects. This should be a very common function in web mapping applications.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2015 03:09:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688060#M64034</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2015-10-02T03:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688061#M64035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote a web application about a year ago that uses the HTML canvas to create a thumbnail image of a map.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/WSDOT-GIS/arcgis-map-thumbnail-builder" title="https://github.com/WSDOT-GIS/arcgis-map-thumbnail-builder"&gt;WSDOT-GIS/arcgis-map-thumbnail-builder · GitHub&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2015 16:03:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688061#M64035</guid>
      <dc:creator>JeffJacobson</dc:creator>
      <dc:date>2015-10-02T16:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688062#M64036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; How cross platform is this solution?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2015 16:12:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688062#M64036</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-10-02T16:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688063#M64037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Everything is done client-side, so the only requirement is a modern web browser.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2015 17:04:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688063#M64037</guid>
      <dc:creator>JeffJacobson</dc:creator>
      <dc:date>2015-10-02T17:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688064#M64038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice! I am using the "print" service as our "export" feature. For browser printing, I am simply scraping the HTML from the map container and creating a static print pop-up. This works fairly well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2015 14:41:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688064#M64038</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2015-10-05T14:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688065#M64039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah yes @simu_xu, I agree many things were easier in Flash. Some, were even better, to this day. This particular thing though is because Flash as a plugin can cut through browser security restrictions. Javascript not being able to take screenshots is a good security restriction. Re-rendering the DOM like my Screenshot&lt;A href="https://community.esri.com/migration-blogpost/54697"&gt;Kevin's Custom WAB Widgets&lt;/A&gt;​&amp;nbsp; or Jeff Jacobson's is really the only way, but I can see how it is useful. And Jeff, that is a neat widget! Thanks for sharing!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, due to various issues with my Screenshot widget like rendering complex text labels and annotations, I had to punt so to speak.&amp;nbsp; I copied the About widget, then put in a photo of a keyboard with the Print Screen key highlighted and a message that simply tells users to use their Print Screen key. (They're Windows users. For Mac, you could just add text for the Cmd-Shft-3 key combo).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Oct 2015 21:50:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688065#M64039</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-10-06T21:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Export the map to an image, client-side, for printing?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688066#M64040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a great utility! &amp;nbsp;I'm having a small issue and am hoping you can provide some guidance. &amp;nbsp;When I create my map 'screenshot' it is the same size as the map view in my application. &amp;nbsp;I would like to make the screenshot a thumbnail size. &amp;nbsp;Can you offer any direction on how to do this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Right after posting this I though I'd try modifying the CSS stylesheet...worked like a charm!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2017 17:22:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-the-map-to-an-image-client-side-for/m-p/688066#M64040</guid>
      <dc:creator>deleted-user-z9OjN-EoUVWn</dc:creator>
      <dc:date>2017-01-27T17:22:05Z</dc:date>
    </item>
  </channel>
</rss>

