您的位置:首页 > 编程语言

代码插件测试

2013-05-09 11:36 267 查看
# Author:  ESRI
# Date:    July 5, 2010
# Version: ArcGIS 10.0
# Purpose: This script will append multiple PDFs into a single output PDF file.
#          The script is intended to run within a script tool.  There are two
#          parameters:
#               1) Select PDF Files to Append,
#               2) Output PDF.
#
#Notes: The order of the PDFs is based on how they are entered.  The PDF at the
#       top of the list is first followed by those below it.

import arcpy, os, string

#Read input parameters from script tool
PDFList = 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 and append each PDF in the list
for eachPDF in PDFList:
outputPDF.appendPages(str(eachPDF))

#Save the changes and open the result automatically
outputPDF.saveAndClose()
os.startfile(outPDFpath)

#Remove variable reference to file
del outputPDF
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: