Creating a map book with PDFDocumentCreate() and PDFDocumentOpen()
One common scenario for many GIS professionals is the need to create a map book that can then be shared with others. A map book is simply a collection of maps for a particular area and usually contains an index map as well. Map books are often created with PDF files, as they are a common interchange format.
Getting ready
In addition to exporting your maps to PDF, you can also manipulate existing PDF documents or create new PDF documents. You can merge pages, set document open behavior, add file attachments, and create or change document security settings. The PDFDocumentOpen()
function is used to open an existing PDF file for manipulation. PDFDocumentCreate()
creates a new PDF document. These functions are often used in the creation of map books, which is what we'll do in this recipe.
How to do it…
Open IDLE and create a new script window.
Import the
arcpy.mapping
andos
modules:import arcpy.mapping as mapping import os
Set...