Export map to PDF issue (for arcgis 10.0...not 10.1)

3381
9
05-14-2012 06:07 AM
DanDeneau
New Contributor III
Hi All,

I'm having to use ArcGIS 10 to export a map to PDF, and followed the 'export map to pdf using python geoprocessing toolbox' approach detailed at the following URL. I've had some success, it actually prints the PDF with some layers...but...the ESRI basemap layers are not included in the map when I access the geoprocessing toolbox through the REST service "Submit Job/Execute Task".

If I run the 'ExportToPDF' tool on my local machine...it works perfectly...just not through the web service...I've viewed the messages and it's running without error...but the resulting PDF only has my 'operational layers', but NOT the ESRI basemap.

I've run out of ideas on this one...anybody have an idea? I've also attached my result...

thanks,
Dan


http://www.arcgis.com/home/item.html?id=8f16fdeef39c46b3952002b2d85ea5de
0 Kudos
9 Replies
JeffPace
MVP Alum
My only only guess is a proxy issue where the webserver can see you local services but not arcgisonline.  Have you tried (just to rule out) other tiled services?

Also, are you in Web Merc Aux Sphere? or are you projecting you operational layers on the fly.

Hi All,

I'm having to use ArcGIS 10 to export a map to PDF, and followed the 'export map to pdf using python geoprocessing toolbox' approach detailed at the following URL. I've had some success, it actually prints the PDF with some layers...but...the ESRI basemap layers are not included in the map when I access the geoprocessing toolbox through the REST service "Submit Job/Execute Task".

If I run the 'ExportToPDF' tool on my local machine...it works perfectly...just not through the web service...I've viewed the messages and it's running without error...but the resulting PDF only has my 'operational layers', but NOT the ESRI basemap.

I've run out of ideas on this one...anybody have an idea? I've also attached my result...

thanks,
Dan


http://www.arcgis.com/home/item.html?id=8f16fdeef39c46b3952002b2d85ea5de
0 Kudos
DanDeneau
New Contributor III
Hi Jeff,

Thanks for the response. My operational layers are in WGS_1984_Web_Mercator_Auxillary_Sphere, and the ESRI basemap layers are in "Mercator_Auxillary_Sphere". Since the geoprocessing tool works on my local computer, I would think that the projections are ok.

I've tried a few ESRI basemap layers (World Street Map, and World Imagery)...it also takes a couple minutes to export this very simple PDF...which might be a clue. Perhaps when I run the export tool, it starts making requests for the tiles and there's some kind of delay or as you said needs a proxy or something. The thing is all the messages look ok ("successful,etc")...no timeouts that I can see.

Seems to be some kind of difference with how a geoprocessing tool is run through arc catalog vs through the REST service...any idea on how to test/debug this further?

It runs so quickly on my laptop through arc catalog, but through the REST service it takes a couple minutes...hrmmmmm.

thanks,
Dan
0 Kudos
JeffPace
MVP Alum
Sounds like your web server is having difficulties with the requests.  Is it a windows box? have you tried install Desktop on the webserver and running the GP task there?

Maybe its a permissions issue where the ArcGISSOC user is trying to write the tiles to a temp directory that it doesnt have permissions on.
0 Kudos
DanDeneau
New Contributor III
Permissions could be the issue...any idea which directory is used to download tiles before creating the PDF?

I just tested an external/public map service and I'm having the same issue...so seems like you might be onto something. Just have to figure out which directories to give permissions...will poke around the ArcGIS Server Manager and see if any directories are listed there.

will let you know 🙂
0 Kudos
JeffPace
MVP Alum
Permissions could be the issue...any idea which directory is used to download tiles before creating the PDF?

I just tested an external/public map service and I'm having the same issue...so seems like you might be onto something. Just have to figure out which directories to give permissions...will poke around the ArcGIS Server Manager and see if any directories are listed there.

will let you know 🙂


no idea on directory, check your arcgis server log 🙂
0 Kudos
DanDeneau
New Contributor III
I've checked the logs, no help there. But I see the list of "Server Directories" in ArcGIS Server Manager..and am hoping that it's one of those. I have a request in to get permissions for those directories just to test it out.
0 Kudos
JeffPace
MVP Alum
I've checked the logs, no help there. But I see the list of "Server Directories" in ArcGIS Server Manager..and am hoping that it's one of those. I have a request in to get permissions for those directories just to test it out.


in your gp service, what is
gp.ScratchWorkspace = "c:/temp/rasteroutput"

that would be where i start.

remember, that path is a server path, not local
0 Kudos
DanDeneau
New Contributor III
well...since i'm using arcpy:

arcpy.env.scratchWorkspace = '/relTemp/'

the script does find this path, as that's where I'm currently outputting the PDF file...

I'm now thinking it could have something to do with writing to the 'cache' directory (one of the server directories listed in the ArcGIS Server Manager). It's explained in the link below. It makes sense to me that they'd use this 'cache directory' to download tiles/images from map services for quick use later on...rather than using the actual scratch workspace for a geoprocessing tool.



'>http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//0093000000...

0 Kudos
FabioMarconi
New Contributor
Hi all,

I'm facing that issue with ArcGIS 10.0, that is, only when I execute the script locally is possible to generate the PDF with the basemap, but If I try to do it by performing through web service (via browser), the generated PDF doesn't show the basemap layer in it.

Has someone solved that problem and could you please share it in here ?!

Thanks in advance!
0 Kudos