arcgis python 把多个MXD批量导出一个PDF
Posted gisoracle
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了arcgis python 把多个MXD批量导出一个PDF相关的知识,希望对你有一定的参考价值。
# -*- coding: cp936 -*- import arcpy, os, string #Read input parameters from script tool mxdList = string.split(arcpy.GetParameterAsText(0), ";") outPDFpath = arcpy.GetParameterAsText(1) #Create a new PDF object to store the results outputPDF = arcpy.mapping.PDFDocumentCreate(outPDFpath) #Loop through each MXD in the list, export, create a temporary PDF name, # and append to final, output PDF for mxdPath in mxdList: mxd = arcpy.mapping.MapDocument(mxdPath) PDFPath = mxdPath[:-4] + "_gisoracle.pdf" arcpy.mapping.ExportToPDF(mxd, PDFPath) outputPDF.appendPages(str(PDFPath)) os.remove(PDFPath) #Save the changes and open the result automatically outputPDF.saveAndClose() os.startfile(outPDFpath) #Remove variable reference to file del outputPDF
以上是关于arcgis python 把多个MXD批量导出一个PDF的主要内容,如果未能解决你的问题,请参考以下文章