Export to pdf from webservices produces missing layers

Discussion created by bscott-esri-ireland-ie-esridist on Feb 2, 2011
Latest reply on Oct 31, 2011 by jbarrette-esristaff

We are automating map export to pdf using arcpy and have found that in some cases the exported pdf is missing one or more layers, which are sourced from map services.  Experimenting with this in ArcMap (UI) it seems that if you add some services to your map that are a little slow (and not cached) and hit the export button before all the data has been retrieved and drawn on the map, you also get a pdf that is missing pieces or even whole layers. 

Is there any way to force arcmap to check that all the relevant data has been retrieved from the server before firing off the export?  We would hope to avoid building in delays etc to work around this issue.

BTW calling a refresh on the dataframe doesn't help, presumably because that starts a fresh round of requesting the data from the servers, redrawing etc which is subsequently interrupted when the script calls export.