Select to view content in your preferred language

Export to pdf from webservices produces missing layers

725
4
02-02-2011 05:57 AM
BenScott
New Contributor
Hi,

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.

Cheers,
Ben
0 Kudos
4 Replies
JeffBarrette
Esri Regular Contributor
Ben,

We don't have any methods to check to see if layers are completely displayed.  I know you want to avoid introducing delays but have you tried something like:

import time
time.sleep(5) #5 seconds

Does this work?

Jeff
0 Kudos
BenScott
New Contributor
Hi Jeff - thanks for your reply. 

We tried a sleep time and have found that our guess on the cause of the problem was incorrect.  We still get missing layers with a long sleep time in the code, and furthermore we have found that export to jpeg works without an issue (with or without a sleep time).  This would seem to indicate that it is something to do with the way the export tool builds the pdf.  Could it be something to do with memory or cpu resources? 

Cheers,
Ben
0 Kudos
LemvigKommune
Deactivated User
Hi Ben

I had the same problem, but I have solved the problem, my problem was the connection to the data.

If you try to publish the mxd to the server, it will tell you if there is problems with the connection.

If you get an error like this, it's wrong
[ATTACH=CONFIG]9770[/ATTACH]

Try to resolve the connection error, and i think that is that. It worked for me.

Mads
0 Kudos
JeffBarrette
Esri Regular Contributor
Some service layers (e.g., WMS) have built in limitations on the server side.  The server won't serve an image too large in size.

A work around is to reduce the DPI (resolution).  Your ExportToJPEG could be working because its default DPI is 96 whereas the default DPI for PDF is 300.

I hope this helps,
Jeff
0 Kudos