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 where the job should be sent.
Getting ready
arcpy.mapping
provides a PrintMap()
function for printing page layouts or data frames from ArcMap. Before calling PrintMap()
, it is a common practice to call the ListPrinterNames()
function. A particular printer can then be found by iterating the list of printers and used as an input to the PrintMap()
function.
PrintMap()
can print either a specific data frame or the page layout of a map document. By default, this function will use the printer saved with the map document or, if not present in the map document, the default system printer. As I mentioned, you can also use ListPrinterNames()
to get a list of the available printers, and select one of these printers as an input to PrintMap()
. In this recipe, you will...