PrintTask not working with layer Defintion on Dynamic layers.

03-28-2014 10:54 AM
New Contributor
I'm having a problem with the printTask when setting a layerDefinition on a dynamic layer. If I run printTask before a layerDefinition is set the layer appears in the PDF printout, After setting a layerDefinition the layer is missing from the PDF printout.

I've done some digging and editing in Charles with little success. The definition expressions is of the form "STATEABBR IN ('IN','MI','MN','OH')". I've tried using a lower case IN/in but that doesn't seem to be the problem.

I created a js fiddle of the problem , you will see that the printout does not print out the filtered layer, if you remove the the layerDefinition the layer prints fine.

0 Kudos
5 Replies
New Contributor
We are having the same issue.  If you come up with a solution we would love to know about it. 

0 Kudos
New Contributor
Looks like if the server is a 10.21, using the 3.9 API allows the print task to work with layer definitions.
0 Kudos
MVP Regular Contributor
3.9 api????
0 Kudos
Esteemed Contributor

I copied the components of your Fiddle into an index.html webpage to run from my server.  I thought I recomposed the components of the application correctly into a webpage, but it runs very slow.  Can you send the code in a format that I can directly copy it into a .html webpage?

Do you know when the 3.9 api was released?  I looked around for a release date, but could not find one.
0 Kudos
Occasional Contributor II


We are having this exact issue with the 3.14 API and a custom geoprocessing service in ArcGIS Server 10.3.1 to print the map. When we set layer definitions on the Dynamic Layer it will display fine in the browser, but the PDF generated by the print service will not show the annotation layers at all for these layer definitions.

if you ever found what the problem is, or found a workaround we would love to know about it.

At this point I'm wondering if this is a known bug and we should just move on for now, because we've already wasted a lot of time on this. Could there be a format issue between the for Web_Map_as_JSON json sent by the api and the REST service ?


In this image, you can see that the annotation layers 0 and 2 have been added to the visible layers of the Dynamic Layer. These annotations layer are not displayed at all in the PDF when we add the layer definitions shown.


0 Kudos