<?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: PrintTemplate height and width not applied in Print Output in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtemplate-height-and-width-not-applied-in/m-p/298586#M27405</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you set the printTemplate.layout to be "MAP_ONLY"? If so, there should have no problem. I have an app doing exactly the same thing, and I can get the map image showing the exact map area constrained with the drawn rectangle area. The DPI is set to 96. Please note that the exportOptions.width and height only work and required for MAP_ONLY. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you use other layout options, the map size is determined by the map area defined in the map template you choose. With that, if the map size on the template is different than that on the screen, which is true most of the cases, then the map area you see on the printout will be different than that on the screen.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope it helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Oct 2013 21:39:54 GMT</pubDate>
    <dc:creator>JasonZou</dc:creator>
    <dc:date>2013-10-16T21:39:54Z</dc:date>
    <item>
      <title>PrintTemplate height and width not applied in Print Output</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtemplate-height-and-width-not-applied-in/m-p/298585#M27404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using a polygon (rectangle) to define a print region in my map.&amp;nbsp; Before I print, I set the map extent to the extent of the polygon, and in the printTemplate.exportOptions I set the width and height to the polygons extent.getWidth() and extent.getHeight().&amp;nbsp; However, the output includes some of the map that is beyond the polygon and is not just the polygon extent.&amp;nbsp; I have preserveScale = true and dpi is 96 (not sure if that makes a difference).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas or suggestions on what may be going on here?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Oct 2013 16:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtemplate-height-and-width-not-applied-in/m-p/298585#M27404</guid>
      <dc:creator>DK5</dc:creator>
      <dc:date>2013-10-16T16:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: PrintTemplate height and width not applied in Print Output</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtemplate-height-and-width-not-applied-in/m-p/298586#M27405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you set the printTemplate.layout to be "MAP_ONLY"? If so, there should have no problem. I have an app doing exactly the same thing, and I can get the map image showing the exact map area constrained with the drawn rectangle area. The DPI is set to 96. Please note that the exportOptions.width and height only work and required for MAP_ONLY. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you use other layout options, the map size is determined by the map area defined in the map template you choose. With that, if the map size on the template is different than that on the screen, which is true most of the cases, then the map area you see on the printout will be different than that on the screen.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope it helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Oct 2013 21:39:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtemplate-height-and-width-not-applied-in/m-p/298586#M27405</guid>
      <dc:creator>JasonZou</dc:creator>
      <dc:date>2013-10-16T21:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: PrintTemplate height and width not applied in Print Output</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtemplate-height-and-width-not-applied-in/m-p/298587#M27406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the response.&amp;nbsp; I set the layout to be "MAP_ONLY", however it is still off.&amp;nbsp; I think I am missing something with the width and height here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I print with using the height and width of the div the map is hosted in - it prints accurately (what you see on screen matches the print output)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ex. height: 762, width: 1046&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I change the printtemplate exportoptions width and height to be that of the polyline.getExtent().getWidth() / .getHeight() I am getting numbers like height:1032.669...., width: 1047.011...&amp;nbsp; These number are much larger than my map div height and width but the polyline is smaller and fits well within the div.&amp;nbsp; Is there some translation I need to do to convert the geometry extent width and height to screen width and height?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 13:03:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtemplate-height-and-width-not-applied-in/m-p/298587#M27406</guid>
      <dc:creator>DK5</dc:creator>
      <dc:date>2013-10-17T13:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: PrintTemplate height and width not applied in Print Output</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtemplate-height-and-width-not-applied-in/m-p/298588#M27407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You will need to translate the geometry dimension into screen dimension. Here is what I use.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Convert the geometry dimension into screen dimension. geom should be either a polyline or polygon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var extScreenWidth = map.width * (geom.getExtent()).getWidth() / map.extent.getWidth(); var extScreenHeight = map.height * (geom.getExtent()).getHeight() / map.extent.getHeight();&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then round the numbers to convert into integers, and fed to exportOptions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;printTemplate.exportOptions = {&amp;nbsp; width: Math.round(extScreenWidth),&amp;nbsp; height: Math.round(extScreenWidth),&amp;nbsp; dpi: 96 };&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 13:13:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtemplate-height-and-width-not-applied-in/m-p/298588#M27407</guid>
      <dc:creator>JasonZou</dc:creator>
      <dc:date>2013-10-17T13:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: PrintTemplate height and width not applied in Print Output</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtemplate-height-and-width-not-applied-in/m-p/298589#M27408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, that was exactly what I was missing - thank you very much!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 13:25:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtemplate-height-and-width-not-applied-in/m-p/298589#M27408</guid>
      <dc:creator>DK5</dc:creator>
      <dc:date>2013-10-17T13:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: PrintTemplate height and width not applied in Print Output</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtemplate-height-and-width-not-applied-in/m-p/298590#M27409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Glad to help:) Please consider to mark your question as "Answered" so that other people might find it helpful. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 13:30:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtemplate-height-and-width-not-applied-in/m-p/298590#M27409</guid>
      <dc:creator>JasonZou</dc:creator>
      <dc:date>2013-10-17T13:30:21Z</dc:date>
    </item>
  </channel>
</rss>

