It is great to see that the generic ArcPy sample we provided is getting a lot of download hits.
On a previous post, I did a video on how you can setup your Layout MXD to sync multiple data frames to the main data frame, so that you can display a variety of basemaps in separate data frames, all in the one printout.
I also did a post on how you can append a separate page into your one Dekho export, dedicated for a static legend.
But what happens if you wanted to click Print from Dekho once, but have a multi-page PDF, showing your area of interest with multiple basemaps on separate pages?
They are also taking advantage of fetching the data locally (avoiding any loss in quality by cutting out going via a map service) which improves print speed and output quality.
They have kindly shared the modified arcpy script, and this can be seen here (bulk of the tweaking is around lines 166 -208).
- The script utilises pyPDF to merge the individual PDFs into one PDF.
You will need to download the zipped source code from this link. This then needs to be deployed under your python folder e.g. C:\Python26\ArcGIS10.0\Lib
- Either modify the existing DekhoServerPrint.py or create a new one, and publish to ArcGIS Server.
- Create a layout MXD with multiple Data Frames.
- (Optional) For the HQ Printing, you will need to ensure you add all the layers direct from the GDB, direct to the Layout MXD, and ensure they are turned off.
- For multiple data frames the Python script will do the following for each data frame;
- Switch on all of the layers in the “current” data frame.
- Change the scale to what the user wants.
- Update the map name text to be the same as the data frame name.
- Export the layout to PDF
- Switch off all of the layers in the “current” data frame
Once all of the layouts have been exported they are stitched together using the pyPDF library and the final PDF is returned to Dekho.
The map name text comes from the data frame name.
As always, excellent work Eagle! Would love to see how others are using ArcPy with Dekho…