AnsweredAssumed Answered

Javascript PrintTask times out after 10 minutes

Question asked by SamuelHenderson on Jun 9, 2015

Hi everyone,


I'm trying to print a map made using the ArcGIS JavaScript API.  I'm using version 3.11 of the API with ArcGIS Server 10.1.  Here's my test page (which works with very simple KML layers) :


  <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
  <meta http-equiv="x-ua-compatible" content="IE=9" >
  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
  <title>Print Task Test</title>
    var dojoConfig = {
   async : true
  <link rel="stylesheet" href="">
    <link rel="stylesheet" type="text/css" href="">
    <script type="text/javascript" src=""></script>
    html, body, #window, #map {
     height: 100%;
     width: 100%;
     margin: 0;
     padding: 0;
     font-family:arial, helvetica, sans-serif;

    position: absolute;
    top:  10px;
    right: 18px;
    height: 20px;
    box-shadow: none;

<body class="tundra">
  <div id="window">
     <div id="map"  ></div>   

     <div id="buttons">
    <button id="prnt" class="topButton" data-dojo-type="dijit/form/DropDownButton" ><span>Print</span>
     <div  dojoType="dijit/Menu">
      <div  id="png" data-dojo-type="dijit/MenuItem" label="Image(.png)" style='font-size: 13px;'></div>
      <div  id="landscape" data-dojo-type="dijit/MenuItem" label="Landscape(.png)" style='font-size: 13px;'></div>
      <div id="portrait" data-dojo-type="dijit/MenuItem" label="Portrait(.png)" style='font-size: 13px;'></div>
  var map;  
  var PrintTask;
  //var layerResults;

  require ([
   function (KMLLayer, on, connect, dom, query, parser, Map, Scalebar, arcgisUtils, Print, PrintTask,
   PrintTemplate, Popup, esriConfig, Attribution,
   domConstruct, domClass, mouse, Button, Menu, BorderContainer){

    var ext = new esri.geometry.Extent({ "xmin": -17529487, "ymin": 1874364, "xmax": -5084316, "ymax": 7500129, "spatialReference": { "wkid": 102100} });
    map = new esri.Map("map", {  
       extent: ext,
       showAttribution: false,
    var tiled = new esri.layers.ArcGISTiledMapServiceLayer("");

  //var kml = new KMLLayer("", { id: "kml" });
  var kml = new KMLLayer("", { id: "kml" });

    // connect the dropdown list with options for the print template
    on(dom.byId("png"),'click', function () {
     printTaskSetup("MAP_ONLY", "png32");
    on(dom.byId("landscape"),'click', function () {
     printTaskSetup("A4 Landscape", "png32");
    on(dom.byId("portrait"),'click', function () {
     printTaskSetup("A4 Portrait", "png32");
    // create print task
    function printTaskSetup(layout, format){
     var template = new esri.tasks.PrintTemplate();
     template.format = format;
     template.layout = layout;
     template.layoutOptions = {
       "scalebarUnit": "Kilometers",
       "copyrightText": "",
       "showAttribution": false
     template.preserveScale = true;
     var params = new esri.tasks.PrintParameters(); = map;
     params.template = template;
     printTask = new esri.tasks.PrintTask("", { async: true } );
     printTask.execute(params, printResult);
    function printResult(result) {, "_blank")
    function printError(error) {

If I replace line 99 with the line above it ( which is link to a much more complex KML layer) then my GP Task times out after 10 minutes.


I've set up the PrintTools on my GeoProcessing server to be Asynchronous and have set the max records to 500,000 as seen here:

Utilities/PrintingTools (GPServer)


The only reason I can think of for why it times out this way is that the kml file in line 99 is 780KB in size and the KML file that causes the timeout is 4,742KB in size.


What am I doing wrong here?