PDFDocumentOpen
摘要
返回 PDFDocument 对象(对象的内容来自磁盘上的 PDF 文件,并且后续操作之后调用 saveAndClose 将修改初始的 PDF 文件。)
讨论
使用 PDFDocumentOpen 函数来获取现有 PDF 文件的引用并且修改其内容。对于要提交至磁盘的更改,确保执行 PDFDocument 操作后调用 saveAndClose。
语法
PDFDocumentOpen (pdf_path, {user_password}, {master_password})
| 参数 | 说明 | 数据类型 | 
| pdf_path | A string that specifies the path and file name of the PDF file to open. | String | 
| user_password | A string that specifies the user password. User passwords are typically used to restrict opening and specific master-defined operations for a PDF file. | String | 
| master_password | A string that specifies the master password. Master passwords are typically used to restrict setting of user permissions for a PDF file. | String | 
代码示例
PDFDocumentOpen 示例
以下脚本修改 PDF 文档元数据属性并且设置文档以何种样式打开。
import arcpy
pdfDoc = arcpy.mapping.PDFDocumentOpen(r"C:\Project\ParcelAtlasMapBook.pdf")
pdfDoc.updateDocProperties(pdf_title="Atlas Map",
                           pdf_author="ESRI",
                           pdf_subject="Map Book",
                           pdf_keywords="Atlas; Map Books",
                           pdf_open_view="USE_THUMBS",
                           pdf_layout="SINGLE_PAGE")
pdfDoc.saveAndClose()
del pdfDoc
7/10/2012