Printing graphics in a GraphicsLayer

2890
5
Jump to solution
01-14-2014 02:24 AM
AleydisG__Pere
Occasional Contributor
I'm using the PrintTask to export my map to PDF and it's working when I have graphics in the default GraphicsLayer of the map. But if a create a new GraphicsLayer and add new graphics to it the PrintTask won't execute but won't throw an error. Is this a bug?

Does anyone have an example of printing graphics in a GraphicsLayer using PrintTask?
For more details I'm adding polygons to my GraphicsLayer using SimpleFillSymbols.
0 Kudos
1 Solution

Accepted Solutions
AleydisG__Pere
Occasional Contributor
I found the answer here:
http://forums.arcgis.com/threads/78773-Error-using-ESRI-Print-Task-service

Using Chrome I got this message: Uncaught typeerror: Converting circular structure to JSON.
That helped me find what was going on. Firefox console and firebug were not sending any message.

View solution in original post

0 Kudos
5 Replies
JonathanUihlein
Esri Regular Contributor
Odoe has a cool print widget you may be able to get ideas from:

https://github.com/odoe/esri-print-widget


Maybe related:

http://gis.stackexchange.com/questions/58008/printtask-in-arcgis-online-js-api
0 Kudos
AleydisG__Pere
Occasional Contributor
I found the answer here:
http://forums.arcgis.com/threads/78773-Error-using-ESRI-Print-Task-service

Using Chrome I got this message: Uncaught typeerror: Converting circular structure to JSON.
That helped me find what was going on. Firefox console and firebug were not sending any message.
0 Kudos
KenBuja
MVP Esteemed Contributor
You should mark your own post as having answered the question. This will help others when they are searching for a solution to this question.
0 Kudos
JonathanUihlein
Esri Regular Contributor
Glad you found the answer!

By the way, if you aren't seeing any error messages in the console (when there clearly is an error), you can wrap a try/catch around the problematic code.

try{
//code here
}catch(e){
console.log('error', e);
}
0 Kudos
JerrySmith
New Contributor
You mean you are able to add and print image on PDF document, but not capable of printing image in GraphicsLayer? It's really strange. I have never had such problem before.
0 Kudos