AnsweredAssumed Answered

Error when using PrintTask from PrintingTools

Question asked by matrixhazard on Aug 31, 2015
Latest reply on Sep 1, 2015 by thejus.kambi

Greetings

 

I need some help about calling PrintingTools from GeoprocessingServices by using PrintTask Class from ArcGIS API. When I call PrintingTool from using PrintTask by using ArcGIS API javascript, sometimes it comes back with an error.

 

======================================================

 

In my website, there is one function that can save the image from current Map Application. Sometimes it needs to produce numbered pin for locating various places. Sometimes, it is around 20-30 pins. It can go up to around 1000 pins in some cases. (Example is the below images). Then I used PrintTask to call PrintingTools to produce the map image.

map_result1.jpg

 

map_result2.jpg

 

The problem is sometimes, there is an error callback from PrintingTool like the below image. When error is going to happen, it always take a lot of time for PrintTask for calling PrintingTool until it sent back an error.

 

map_result3.jpg

 

This error also occurs even with the same number of pin on map. For example, if there were 10 pins on map. When calling PrintingTool, sometimes it worked, sometimes it didn't and also had an error callback. Sometimes even 1000 pins worked while only 5 pin didn't.

 

When I try to check the error, I'm not sure whether it is related to the parameter that are sent to PrintingTool? I saw that sometimes some parameters are lost, like in the below image.There is no parameter "Web_Map_as_JSON" even though the source stated that it also send this parameter on Json

 

Parameters when somehow it didn't work

 

map_result4.jpg

 

 

Parameters when it worked

 

map_result5.jpg

 

Since I always send these parameters (Format, Layout, Map object) to the PrintTask to call PrintingTool. I'm not sure whether there is any external factors rather than my coding that affects the output.

 

I try to google the problems but no lucks, so I decided to post question here.

 

I hope that someone can help me explain the cause or give me some solutions to this problem

 

Thank you.

Outcomes