How do I run 'Advanced High Quality Printing' service?

1651
6
Jump to solution
12-01-2016 07:33 AM
AndrewDavis2
New Contributor III

Hello, I have been working through a tutorial for setting up a 'Advanced high-quality web map printing/exporting using arcpy.mapping'  ArcGIS Help 10.1 

One of the final steps is to run the tool and capture the results for use in the publishing of the service.  The way that the tutorial shows to run is with the Web_Map_as_JSON param as a single line 

{"operationalLayers":[{"url":"http://MyServer:6080/arcgis/rest/services/USA/ConterminousUSA/MapServer","title":"MyDynamicService","opacity":1,"id":"MyDynamicService","visibility":true,"visibleLayers":[0,2,3,4,5,6,7]}],"mapOptions":{"extent":{"xmin":-2200000,"ymin":500000,"xmax":-1300000,"ymax":1300000,"spatialReference":{"wkid":102008}},"scale":5000000,"rotation":0},"layoutOptions":{"copyrightText":"","authorText":"","legendOptions":{"operationalLayers":[{"id":"MyDynamicService","subLayerIds":[0,2,5]}]}}}

However, the graphic shows the input looking like this.

What is the little input to the left of the  - {"operationalLayers"::....   ?  I cannot tell what this is and when I run the tool I keep getting a 'failure on line 1' error with very little detail.

Any assistance would be very welcome.

Andy..

0 Kudos
1 Solution

Accepted Solutions
DerekLaw
Esri Community Moderator

Just FYI to this thread,

The workflow that Andy describes in his post above is shown in this video,

ArcGIS for Server 10.1: PrintingTools Service Tutorial

Hope this helps,

View solution in original post

6 Replies
DaveHighness
Occasional Contributor II

Andy, one problem is that the map service in that Web Map may not really exist or be something that you can hit from your machine. Can you hit this URL?

http://MyServer:6080/arcgis/rest/services/USA/ConterminousUSA/MapServer

Dave

0 Kudos
AndrewDavis2
New Contributor III

Yes, I can hit that service..  cause it has my actual server name in my working dataset.  I have a test server that I use when I am running the tutorial I have my server name in the actual url.  When I typed this up I took the information from the tutorial write up.. 

Andy

0 Kudos
JonathanQuinn
Esri Frequent Contributor

The Web_Map_as_JSON parameter is optional, so what if you run the tool without providing anything for that parameter?  You simply need a successful run of the tool; once published, the API will provide the JSON.

0 Kudos
AndrewDavis2
New Contributor III

Hey, Thanks...  I ended up going with something completely different.

0 Kudos
AndrewDavis2
New Contributor III

Once again, I found the answer (with help) and it demonstrated my ignorance..  So..

Here you go..  If you want to use a Print Service this is one way (I am sure it is not the only way)

If you have an ArcServer instance set up and it's 10.2 or greater you can run the Server Tools.tbx tool "ExportWebMap" and publish it as a service.  Look into running the "Printing" tools on your instance of server, ESRI has made it easier than I knew..

1.)  In ArcMap (I'm doing this on the machine which is also my ArcServer) copy the 'Export Web Map' tool from inside the 'ServerTools.tbx' to your 'MyToolBoxes' location in the Catalog window.

2.) Run the tool. 

   I used this json for the map json.

   {"mapOptions":{"showAttribution":false,"extent":{"xmin":-14212719.704842241,"ymin":2447533.2834749413,"xmax":-6987280.295103023,"ymax":6752466.716494923,"spatialReference":{"wkid":102100}},"spatialReference":{"wkid":102100},"scale":18489297.737236},"operationalLayers":[{"id":"defaultBasemap","title":"defaultBasemap","opacity":1,"minScale":591657527.591555,"maxScale":70.5310735,"url":"http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"},{"id":"map_graphics","opacity":1,"minScale":0,"maxScale":0,"featureCollection":{"layers":[]}}],"exportOptions":{"outputSize":[670,500],"dpi":192}}

3.) Share the results as a service, right click the results and ..  (go through and check everything the way you would normally publish a service from the 'Results' window on your ArcMap.  You can add your own 'templates' if you so desire.

   You should see a 'Rest' url in the results window which you can use.  You can visit on a browser at that point.  You can also 'test' it out from there just re-use the above json.  Here is a sample endpoint which was avail to hit on.

Execute Task (Export Web Map Task) 

4.) If you are going to use this from a web app which you have built in jsapi you can look to

https://developers.arcgis.com/javascript/3/samples/widget_print/

Use the link to explore how to incorporate (or redirect to your print service) .

I hope this helps someone, once again thanks to the folks who were kind enough to reply.  At one point in the past I thought I would learn it all, now I struggle to keep up....

Andy.

DerekLaw
Esri Community Moderator

Just FYI to this thread,

The workflow that Andy describes in his post above is shown in this video,

ArcGIS for Server 10.1: PrintingTools Service Tutorial

Hope this helps,