For my work, I designed a tool to create PDF maps with large amount of data, intersected with 5 buffer rings using ArcPy. The job involves intersecting points, selecting points, generating Elevation for the points and distance from the order location (the centre of the buffers). The job works fine for single map and takes only 2-3 minutes.

But some other requirements came up and now I am appending two more PDF to the original PDF but with different extents based on the ring radii. The job is taking as long as 8-9 minutes. If I create mapbook with data driven pages, it is not that slow. I have tried different resolution, it is somewhat efficient with less dpi but project manager is not happy about it. We are using 400 dpi instead of default 300 dpi. Also, Layers and attributes both are required for reports- though that change did not effect time that much. The scaling of tool is unknown too. The original design was meant for 1000 times uses in one month, but business is launching in another jurisdiction, so not sure about the number of uses down the road. And with more uses and longer run time- the tool will be running into 'Execution of job XXX failed because of crash or termination of the server object.' regardless of ArcGIS service time change.

Has anyone used another PDF generation tool with in Python to generate maps?

if (country.lower()== 'xy'):
            scale = df.scale * 1.1
            df.scale = ((int(scale)/100)+1)*100
            MainTitleTextElement.text= "Map : "+ Buffer4 + " Mile Radius"
            outputLayoutPDF4 = os.path.join(scratch, 'mapExport4.pdf')
            arcpy.mapping.ExportToPDF(mxd, outputLayoutPDF4, "PAGE_LAYOUT", 640, 480, 400, "FASTER", "RGB", True, "ADAPTIVE", "RASTERIZE_BITMAP", False, True, "LAYERS_AND_ATTRIBUTES", True, 90) 
            scale = df.scale * 1.1
            df.scale = ((int(scale)/100)+1)*100
            MainTitleTextElement.text= "Map : "+ Buffer3 + " Mile Radius"
            outputLayoutPDF3 = os.path.join(scratch, 'mapExport3.pdf')
            arcpy.mapping.ExportToPDF(mxd, outputLayoutPDF3, "PAGE_LAYOUT", 640, 480, 400, "FASTER", "RGB", True, "ADAPTIVE", "RASTERIZE_BITMAP", False, True, "LAYERS_AND_ATTRIBUTES", True, 90)        

1 Answer 1


I suggest expending effort cutting down the drawing time of the mxd rather than focusing on the python export process. There's some information about that here:

Esri KB 34043 - HowTo: Improve printing or exporting performance

  • I have large files or sometimes multiple files to cover whole country as basemaps in MXD. But I have two issues in splitting the data: 1. The order can be from anywhere in the country and it can be on any border (state or county) 2. address information, provided may or may not be accurate, I go by coordinates. Is creating cache of these large files a good idea to bring on the map?
    – Deep
    Jun 5, 2013 at 20:39
  • I would go by the advice in the KB - use basemap layers if they meet your needs. There is a break-off point where creating a cache is not worth it, and you can set up caches to only work in certain areas. Jun 12, 2013 at 18:41
  • I have not implemented yet but I am planning to clip a larger area from the layers and bring those as base maps. yeah, Cache won't work since tiles size won't suffice my scale which can change based on buffer size for different orders.
    – Deep
    Jun 13, 2013 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.