Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By : Donald Eric Pimpler, Eric Pimpler
Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By: Donald Eric Pimpler, Eric Pimpler

Overview of this book

Table of Contents (22 chapters)
Programming ArcGIS with Python Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 of a map document. By default, this function will use the printer saved with the map document or, the default system printer in the map document. As I mentioned earlier, you can also use ListPrinterNames() to get a list of the available printers, and...