<?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: Print widget prints wrong extent in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549045#M51106</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeff, you can't use custom code or custom widgets if you're talking about an application hosted in ArcGIS Online. If you're hosting the app yourself, then you're fine, but AGO will not allow customized code like this for security reasons.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jan 2020 16:33:54 GMT</pubDate>
    <dc:creator>Noah-Sager</dc:creator>
    <dc:date>2020-01-17T16:33:54Z</dc:date>
    <item>
      <title>Print widget prints wrong extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549039#M51100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to add print functionality to a 4.x solution I'm working on using the PrintViewModel. I'm able to use all the functionality as described in the documentation, but there seems to be an inherent problem&amp;nbsp;where the actual printout (pdf) returned from the printservice only contain a portion of the&amp;nbsp;map that is visible in the browser.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's very easy to reproduce this by&amp;nbsp;opening the official print sample in fullscreen (&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-print/live/index.html" title="https://developers.arcgis.com/javascript/latest/sample-code/widgets-print/live/index.html"&gt;Print widget - 4.14&lt;/A&gt;), and hitting print. The resulting printout will vary depending on your screen size, but in the majority of cases the printout will only contain a center envelope of the map which is displayed in the application.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are some screenshots to illustrate the problem:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what the user sees in the browser window when hitting print:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="478577" alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/478577_want.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the result from&amp;nbsp; the print service:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="478578" alt="" class="jive-emoji jive-image image-2 j-img-original" src="https://community.esri.com/legacyfs/online/478578_result.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not a new problem and I've seen several&amp;nbsp;questions about this on other forums. The problem also exists in version 3.x. Probably the problem is more connected to the print service than the JS api.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using the map-only option in PrintTemplate&amp;nbsp;to specify a width and a height, and this kind of solves the problem, but then I'm stuck with a new problem which is that it is impossible to include a legend when printing using map-only.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For those of you familiar with Geocortex (which is a partner of ESRI), I've noticed that they have somehow solved the problem there, but I cannot access any readable source code to figure out how they've done it. In geocortex applications they show a print preview box, which illustrates what is going to be included in the printout. They also allow the user to specify which scale to use in the print. I want to build the same kind of printing functionality in my solution but currently I'm stuck with the bug above. If I at least could add a preview box so that the user could see what would be included in the printout that would be a huge step in the right direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, does anyone have any advice/suggestions?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2020 14:23:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549039#M51100</guid>
      <dc:creator>ae</dc:creator>
      <dc:date>2020-01-16T14:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Print widget prints wrong extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549040#M51101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are some limitations when working with the Print widget. It is designed to be a simple, out-of-the-box solution for most use cases. Typically, we'd recommend using the PrintTask if you want finer grained control over the printout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, there are a couple of options that might be useful. First, you can modify the scale of the printout by changing the scale in the Print widget UI (under Advanced options) by setting the Set scale to true, and supplying a useful scale number (I used 40,000,000 as a test for the Print widget sample). Alternatively, you can also do this programmatically like in the codepen below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another approach is to use the takeScreenshot() method. This is a more interactive tool that can allow a user to select (similar to preview) the target area for printing. We have a live working sample using a 3D SceneView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope&amp;nbsp;this information is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print scale sample (codepen)&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://codepen.io/noash/pen/abzaQBe" title="https://codepen.io/noash/pen/abzaQBe"&gt;https://codepen.io/noash/pen/abzaQBe&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapView.takeScreenshot() method doc&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot"&gt;MapView | ArcGIS API for JavaScript 4.14&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Screenshot of SceneView sample&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/sample-code/sceneview-screenshot/index.html" title="https://developers.arcgis.com/javascript/latest/sample-code/sceneview-screenshot/index.html"&gt;Take a screenshot of a SceneView | ArcGIS API for JavaScript 4.14&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit:&lt;/P&gt;&lt;P&gt;takeScreenshot() blog&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/RLibed-esristaff/blog/2018/12/20/screenshots-with-the-arcgis-api-for-javascript-html2canvas"&gt;https://community.esri.com/people/RLibed-esristaff/blog/2018/12/20/screenshots-with-the-arcgis-api-for-javascript-html2canvas&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2020 21:30:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549040#M51101</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2020-01-16T21:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Print widget prints wrong extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549041#M51102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How could I incorporate the screenshot into a arcgis online web application? This I am finding is probably the closest thing to a print preview.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2020 12:20:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549041#M51102</guid>
      <dc:creator>JeffHyder</dc:creator>
      <dc:date>2020-01-17T12:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Print widget prints wrong extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549042#M51103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the input Noah. I actually managed to solve my problem, and create a preview box for the print (using only the printViewModel and some custom logic). My printouts now only contain the portion of the map that is visible within the preview box. The user selects which map scale to use in a dropdown, and the bounding box updates accordingly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The key to solving my problem was to understand&amp;nbsp;the relationship between pixels and resolutions. Each zoom level has a specific resolution, and that resolution defines how many map units (for example meters) there will be in one pixel. Using this information it is possible to calculate the area that will be included in a printout and highlight this area in the map. You also need to know exactly how big the map image in the printout will be (in pixels).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can add a fiddle to better explain my solution later, if other users are interested (I'm guessing Noah already know what I'm talking about &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;).&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2020 12:23:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549042#M51103</guid>
      <dc:creator>ae</dc:creator>
      <dc:date>2020-01-17T12:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Print widget prints wrong extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549043#M51104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would love to know. I am really green at this and am using a AOL web application. Is this something I could incorporate into that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2020 12:33:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549043#M51104</guid>
      <dc:creator>JeffHyder</dc:creator>
      <dc:date>2020-01-17T12:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Print widget prints wrong extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549044#M51105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not familiar with implementing stuff for AGOL webapps, but I guess it's based on the JS API and I think you can make your own widgets, so&amp;nbsp;it's probably possible to build a widget using the same logic I'm using. I will provide a sample of what I have built soon, but this will be a pure arcgis js implementation, and not an AGOL webapp widget.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2020 15:02:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549044#M51105</guid>
      <dc:creator>ae</dc:creator>
      <dc:date>2020-01-17T15:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Print widget prints wrong extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549045#M51106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeff, you can't use custom code or custom widgets if you're talking about an application hosted in ArcGIS Online. If you're hosting the app yourself, then you're fine, but AGO will not allow customized code like this for security reasons.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2020 16:33:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549045#M51106</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2020-01-17T16:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Print widget prints wrong extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549046#M51107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your solution sounds interesting. Would love to see a fiddle when you're done. I bet others would be curious to see your approach as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2020 16:41:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/549046#M51107</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2020-01-17T16:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Print widget prints wrong extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/1265499#M80485</link>
      <description>&lt;P&gt;I know this is a little late but would love to see a fiddle as well!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 15:58:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/1265499#M80485</guid>
      <dc:creator>BryanMc</dc:creator>
      <dc:date>2023-03-08T15:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Print widget prints wrong extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/1297321#M81319</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/169842"&gt;@Noah-Sager&lt;/a&gt;&amp;nbsp;. I know this is an old posting but I thought it is relevant. I am trying to modify the print widget&amp;nbsp; to print on a user defined bounding box. I am not using an app in the portal. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 19:05:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/1297321#M81319</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2023-06-08T19:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Print widget prints wrong extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/1310713#M81758</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/14521"&gt;@LefterisKoumis&lt;/a&gt;&amp;nbsp;Try the PrintPlus widget. Though at my last attempt, it required some modifications to print the proper scale/bounded area as well. Apologies if I misunderstood your request.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 21:48:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/1310713#M81758</guid>
      <dc:creator>Kara_Lara</dc:creator>
      <dc:date>2023-07-21T21:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Print widget prints wrong extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/1310721#M81759</link>
      <description>&lt;P&gt;Thank you for the response. Does the print plus work with JS 4.x ?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 21:55:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-widget-prints-wrong-extent/m-p/1310721#M81759</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2023-07-21T21:55:03Z</dc:date>
    </item>
  </channel>
</rss>

