I've been tasked with creating a custom web app hosted in ArcGIS Online that has the ability to export out data driven pages through a printing service (we also have ArcGIS Server). Within the printing widget, I noticed you can point to a printing service.
What we want to be able to do is have any user query features, go through the printing widget and have it export out a multi-page PDF of all features that are queried. I am familiar with sharing the "Get Layout Templates Info" as a geoprocessing service but I'm running into a bit of trouble with the data driven pages aspect.
Greetings. Any luck coming up with a solution for this problem?
Any luck on this? I need to do exactly this for two different sites, one for a single page output, and one for a multi-page output.
I've had a bit of luck and I was able to get it working locally. What you'll need to do (this may now be outdated) is to write a custom ArcPy script and publish it as a GP service to ArcServer. Then, anytime someone clicks the 'print' button, it will execute the script that's living on the server.
Within the script it should look on the server for a DDP enabled mxd in a registered folder which is specified in the script (name and location) then, the two main tools you'd want to use are: ConvertWebMapToMapDocument and dataDrivenPages.exportToPDF. I currently just have it exporting the pdf to a temporary folder on the user's C drive using arcpy.env.scratchFolder which then opens using os.startfile