<?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 JavaScript API Print and Print Template &amp;quot;execute not define&amp;quot; in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1085723#M74131</link>
    <description>&lt;P&gt;Hi Esri Community,&lt;/P&gt;&lt;P&gt;We run into a problem, We generate the Custom Maps and try to implement the "Print" API with "Print Templates" that listed in documentation here:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-print.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-print.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;When we implement the JavaScript Request but it's give&amp;nbsp; Error "(index):23 Uncaught ReferenceError: execute is not defined"&lt;/P&gt;&lt;P&gt;I checked the Documentation and there is noting to add anything in the Require for Execute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the Code Example that we are using:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;  &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.20/esri/themes/light/main.css"&amp;gt;
  &amp;lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script src="https://js.arcgis.com/4.20/"&amp;gt;&amp;lt;/script&amp;gt;

require([
"esri/config",
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/layers/MapImageLayer",
"esri/identity/OAuthInfo",
"esri/identity/IdentityManager",
"esri/Basemap",
"esri/layers/VectorTileLayer",
"esri/layers/TileLayer",
"esri/rest/print",
"esri/rest/support/PrintTemplate",
"esri/rest/support/PrintParameters",
"esri/tasks/QueryTask",
"esri/rest/query"
], function(esriConfig, Map, MapView, FeatureLayer, MapImageLayer, OAuthInfo, esriId, Basemap, VectorTileLayer, TileLayer, Print, PrintTemplate, PrintParameters, QueryTask, Query) {&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;We create our Maps like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Income Map
    var map = new Map({ basemap: "arcgis-topographic" });
    var view = new MapView({ map: map, center: [-94.7148669, 38.9065419], zoom: 14, container: "viewDiv2" });
    const income_main = new MapImageLayer({ portalItem: { id: "ID" } });
    map.add(income_main);

	esriConfig.request.interceptors.push({ urls: Zipcode_Layer, before: function (params) {
	params.requestOptions.query = params.requestOptions.query || {};
	params.requestOptions.query.token = access_token; },});

   
    var zipcode = new FeatureLayer({
		url: Zipcode_Layer
    });
    map.add(zipcode);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After Map Creation we implement this code for Print API:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; var url55 = "https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task/execute";
	 const template = new PrintTemplate({
     format: "png",
     exportOptions: {
       dpi: 300
     },
     layout: "a4-portrait",
     layoutOptions: {
       titleText: "Gillette Stadium",
       authorText: "Thomas"
     }
    });
    const params = new PrintParameters({
     view: view,
     template: template
    });
   // execute(url50, params).then(printResult).catch(printError);
    execute(url55, params).then(printResult).catch(printError);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it's give an error "(index):23 Uncaught ReferenceError: execute is not defined" Is there anyone who can help to fix the problem...&lt;BR /&gt;&lt;BR /&gt;Thank You&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Aug 2021 14:56:36 GMT</pubDate>
    <dc:creator>LeeRipma</dc:creator>
    <dc:date>2021-08-04T14:56:36Z</dc:date>
    <item>
      <title>JavaScript API Print and Print Template "execute not define"</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1085723#M74131</link>
      <description>&lt;P&gt;Hi Esri Community,&lt;/P&gt;&lt;P&gt;We run into a problem, We generate the Custom Maps and try to implement the "Print" API with "Print Templates" that listed in documentation here:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-print.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-print.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;When we implement the JavaScript Request but it's give&amp;nbsp; Error "(index):23 Uncaught ReferenceError: execute is not defined"&lt;/P&gt;&lt;P&gt;I checked the Documentation and there is noting to add anything in the Require for Execute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the Code Example that we are using:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;  &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.20/esri/themes/light/main.css"&amp;gt;
  &amp;lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script src="https://js.arcgis.com/4.20/"&amp;gt;&amp;lt;/script&amp;gt;

require([
"esri/config",
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/layers/MapImageLayer",
"esri/identity/OAuthInfo",
"esri/identity/IdentityManager",
"esri/Basemap",
"esri/layers/VectorTileLayer",
"esri/layers/TileLayer",
"esri/rest/print",
"esri/rest/support/PrintTemplate",
"esri/rest/support/PrintParameters",
"esri/tasks/QueryTask",
"esri/rest/query"
], function(esriConfig, Map, MapView, FeatureLayer, MapImageLayer, OAuthInfo, esriId, Basemap, VectorTileLayer, TileLayer, Print, PrintTemplate, PrintParameters, QueryTask, Query) {&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;We create our Maps like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Income Map
    var map = new Map({ basemap: "arcgis-topographic" });
    var view = new MapView({ map: map, center: [-94.7148669, 38.9065419], zoom: 14, container: "viewDiv2" });
    const income_main = new MapImageLayer({ portalItem: { id: "ID" } });
    map.add(income_main);

	esriConfig.request.interceptors.push({ urls: Zipcode_Layer, before: function (params) {
	params.requestOptions.query = params.requestOptions.query || {};
	params.requestOptions.query.token = access_token; },});

   
    var zipcode = new FeatureLayer({
		url: Zipcode_Layer
    });
    map.add(zipcode);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After Map Creation we implement this code for Print API:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; var url55 = "https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task/execute";
	 const template = new PrintTemplate({
     format: "png",
     exportOptions: {
       dpi: 300
     },
     layout: "a4-portrait",
     layoutOptions: {
       titleText: "Gillette Stadium",
       authorText: "Thomas"
     }
    });
    const params = new PrintParameters({
     view: view,
     template: template
    });
   // execute(url50, params).then(printResult).catch(printError);
    execute(url55, params).then(printResult).catch(printError);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it's give an error "(index):23 Uncaught ReferenceError: execute is not defined" Is there anyone who can help to fix the problem...&lt;BR /&gt;&lt;BR /&gt;Thank You&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 14:56:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1085723#M74131</guid>
      <dc:creator>LeeRipma</dc:creator>
      <dc:date>2021-08-04T14:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API Print and Print Template "execute not define"</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1085730#M74134</link>
      <description>&lt;P&gt;It would look like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require([
  "esri/rest/print"
], function(print) {
  print.execute(url, params);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The execute method exists on the print module you imported.&lt;/P&gt;&lt;P&gt;The code snippet in the doc assumes you are using ES6 import syntax.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { execute } from "@arcgis/core/rest/print";

execute(url, params);&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 04 Aug 2021 15:21:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1085730#M74134</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-08-04T15:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API Print and Print Template "execute not define"</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1085765#M74136</link>
      <description>&lt;P&gt;Hi Rena Rubalcava, Thanks for your answer when I implement the code that you provide it's bypass that problem but still giving error&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Error executing tool. Export Web Map Task : Required 'mapOptions.extent' property missing from web map JSON. Failed to execute (Export Web Map). Failed to execute (Export Web Map Task).&lt;/SPAN&gt;"&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 15:56:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1085765#M74136</guid>
      <dc:creator>LeeRipma</dc:creator>
      <dc:date>2021-08-04T15:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API Print and Print Template "execute not define"</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1085772#M74139</link>
      <description>&lt;P&gt;I even added the Extent in the Map as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt; var map = new Map({ basemap: "arcgis-topographic" });
    var view = new MapView({ map: map, extent: { xmin: -9177811, ymin: 4247000, xmax: -9176791, ymax: 4247784, spatialReference: 102100 },  zoom: 14, container: "viewDiv2" });
    const income_main = new MapImageLayer({ portalItem: { id: "ID" } });
    map.add(income_main);

	esriConfig.request.interceptors.push({ urls: Zipcode_Layer, before: function (params) {
	params.requestOptions.query = params.requestOptions.query || {};
	params.requestOptions.query.token = access_token; },});

   
    var zipcode = new FeatureLayer({
		url: Zipcode_Layer
    });
    map.add(zipcode);
	 var url50 = "https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task";
	 const template = new PrintTemplate({
     format: "PNG32",
     exportOptions: {
       dpi: 300
     },
     layout: "a4-portrait",
     layoutOptions: {
       titleText: "Gillette Stadium",
       authorText: "Thomas"
     }
    });
    const params = new PrintParameters({
     view: view,
     template: template
    });
	  
   
   // execute(url50, params).then(printResult).catch(printError);
  
    var imageExport = print.execute(url50, params);

	  console.log(imageExport);
  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 20:43:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1085772#M74139</guid>
      <dc:creator>LeeRipma</dc:creator>
      <dc:date>2021-08-12T20:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API Print and Print Template "execute not define"</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1085829#M74140</link>
      <description>&lt;P&gt;Ok, I checked this out. "png" is not a format option. It's png8 or png32. Change that and it should work.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-PrintTemplate.html#format" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-PrintTemplate.html#format&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 16:44:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1085829#M74140</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-08-04T16:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API Print and Print Template "execute not define"</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1086215#M74165</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7384"&gt;@ReneRubalcava&lt;/a&gt;&amp;nbsp; Did you check this, Where I already update the PNG and Add the Extent but still giving me error for Extent&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 16:03:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1086215#M74165</guid>
      <dc:creator>LeeRipma</dc:creator>
      <dc:date>2021-08-05T16:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript API Print and Print Template "execute not define"</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1086226#M74166</link>
      <description>&lt;P&gt;Not sure, but this works&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/XWRPazr?editors=0010" target="_blank"&gt;https://codepen.io/odoe/pen/XWRPazr?editors=0010&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 16:18:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-api-print-and-print-template-quot/m-p/1086226#M74166</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-08-05T16:18:56Z</dc:date>
    </item>
  </channel>
</rss>

