<?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: PrintTask(url, params?) - Cannot find documentation for tha params options? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-url-params-cannot-find-documentation-for/m-p/320#M18</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The Print widget/dijit uses the PrintTask behind the scenes. The print widget/dijit takes care of asking the print service for available printTemplates and some other stuff that you will have to define in your code if you choose to use PrintTask.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a code snippet of how I use it most often:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var printTask = new PrintTask('&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://someserver/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task');" rel="nofollow noopener noreferrer" target="_blank"&gt;http://someserver/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task');&lt;/A&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var template = new PrintTemplate();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.exportOptions = {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 740,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: (740/oWid) * oHgt,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dpi: 96
&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; this.imgHeight = (740/oWid) * oHgt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.format = "jpg";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.layout = "MAP_ONLY";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.preserveScale = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.showAttribution = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.outScale = this.map.getScale();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var params = new PrintParameters();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; params.map = this.map;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; params.template = template;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printTask.execute(params, lang.hitch(this, this.printResult));

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printResult: function(rsltURL){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //now do something with the generated image using the returned URL
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 20:01:59 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2021-12-10T20:01:59Z</dc:date>
    <item>
      <title>PrintTask(url, params?) - Cannot find documentation for tha params options?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-url-params-cannot-find-documentation-for/m-p/317#M15</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Are there any sample using the PrintTask class? What does this class provide over the print widget/digit?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain better than what the docs do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Subu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 18:32:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-url-params-cannot-find-documentation-for/m-p/317#M15</guid>
      <dc:creator>SubuSwaminathan1</dc:creator>
      <dc:date>2015-05-11T18:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: PrintTask(url, params?) - Cannot find documentation for tha params options?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-url-params-cannot-find-documentation-for/m-p/318#M16</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I use the PrintTask quite often. I have many custom widgets that do not need to provide a UI like the print widget/dijit does so I just use PrintTask to get an export of the map as a JPG to put into an img element.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 18:44:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-url-params-cannot-find-documentation-for/m-p/318#M16</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-05-11T18:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: PrintTask(url, params?) - Cannot find documentation for tha params options?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-url-params-cannot-find-documentation-for/m-p/319#M17</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/printtask-amd.html" title="https://developers.arcgis.com/javascript/jsapi/printtask-amd.html"&gt;PrintTask | API Reference | ArcGIS API for JavaScript&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The esri docs appear to indicate more 'granular control' - I am just wondering what that really means as I cannot find any samples that illustrate that point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert - Are you saying that the PrintTask is the same as the print digit/widget without the UI button or drop-down list? Making sure I am understanding it right.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 18:54:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-url-params-cannot-find-documentation-for/m-p/319#M17</guid>
      <dc:creator>SubuSwaminathan1</dc:creator>
      <dc:date>2015-05-11T18:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: PrintTask(url, params?) - Cannot find documentation for tha params options?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-url-params-cannot-find-documentation-for/m-p/320#M18</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The Print widget/dijit uses the PrintTask behind the scenes. The print widget/dijit takes care of asking the print service for available printTemplates and some other stuff that you will have to define in your code if you choose to use PrintTask.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a code snippet of how I use it most often:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var printTask = new PrintTask('&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://someserver/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task');" rel="nofollow noopener noreferrer" target="_blank"&gt;http://someserver/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task');&lt;/A&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var template = new PrintTemplate();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.exportOptions = {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 740,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: (740/oWid) * oHgt,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dpi: 96
&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; this.imgHeight = (740/oWid) * oHgt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.format = "jpg";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.layout = "MAP_ONLY";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.preserveScale = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.showAttribution = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template.outScale = this.map.getScale();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var params = new PrintParameters();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; params.map = this.map;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; params.template = template;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printTask.execute(params, lang.hitch(this, this.printResult));

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printResult: function(rsltURL){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //now do something with the generated image using the returned URL
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:01:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-url-params-cannot-find-documentation-for/m-p/320#M18</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-10T20:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: PrintTask(url, params?) - Cannot find documentation for tha params options?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-url-params-cannot-find-documentation-for/m-p/321#M19</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What kind of value is the outScale parameter looking for?&amp;nbsp; Would this be the scale in layout units or map units?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 15:56:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-url-params-cannot-find-documentation-for/m-p/321#M19</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2015-07-14T15:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: PrintTask(url, params?) - Cannot find documentation for tha params options?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-url-params-cannot-find-documentation-for/m-p/322#M20</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not very clear documentation from esri on this. For what I was trying to do, I commented out &lt;SPAN class="keyword"&gt;this line from Robert's response -"template.preserveScale = &lt;SPAN class="keyword"&gt;false;" &lt;/SPAN&gt;. So went with the default there and then my code worked as I wanted.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="keyword"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;If you print the outScale (template.outScale) to your browser console, you will see that the value printed is a map scale - 100,000 from 1:100,000 etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But Setting the outScale parameter did not work from me - I was trying to set it to actual map scale and not layout or map units.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 16:40:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-url-params-cannot-find-documentation-for/m-p/322#M20</guid>
      <dc:creator>SubuSwaminathan1</dc:creator>
      <dc:date>2015-07-14T16:40:44Z</dc:date>
    </item>
  </channel>
</rss>

