Printing maps with PrintMap()

Sending your map layout to a printer is easy with the PrintMap() function. By default, the print job will be sent to the default printer saved with the map document, but you can also define a specific printer to which the job should be sent.

Getting ready

The arcpy.mapping module provides a PrintMap() function to print page layouts or data frames from ArcMap. Before calling PrintMap(), it is a common practice to call the ListPrinterNames() function, which returns a list of the available printers for the local computer. A particular printer can then be found by iterating the list of printers that can be used as an input for the PrintMap() function.

PrintMap() can print either a specific data frame or the page layout ...

Get Programming ArcGIS with Python Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.