为导出准备地图文档
创建范围指示器并记录脚本所需信息之后,设置地图文档,避免每一页上都显示范围指示器或插图。
步骤:
- 将包含插图的数据框移出页面的可打印范围。
- 将插图的范围更改为比主数据框的范围大很多,使得范围指示器不会出现在不想其出现的页面上。
![](http://www.dsac.cn/file/attached/image/20140609/20140609113616_9080.jpg)
- 保存地图文档。
编写导出脚本
下面显示一个示例脚本,该脚本将导出在第 1 页和第 3 页上有插图的地图册。
下面的脚本将导出在第 1 页和第 3 页上有插图的地图册。
import arcpy, os
# Create an output directory variable
#
outDir = r"C:\Project\MapBook\final_output"
# Create a new, empty pdf document in the specified output directory
# This will be your final product
finalpdf_filename = outDir + r"\FinalMapBook.pdf"
if os.path.exists(finalpdf_filename): # Check to