简体   繁体   English

以编程方式更改PDF作者

[英]Changing a PDF author programmatically

In my office we have about 1000 PDFs that have arbitrary title and author information. 在我的办公室中,我们大约有1000个PDF,这些PDF具有任意的标题和作者信息。 My bosses had a spreadsheet created with the PDFs filename and an appropriate title and appropriate author information. 我的老板创建了一个电子表格,其中包含PDF文件名,适当的标题和适当的作者信息。

I would like to find a programmatic way to move the data from the Excel sheet to the PDF attributes? 我想找到一种编程方式将数据从Excel工作表移动到PDF属性吗?

My preferred language is Python so I looked for a Python library to do this, each library I looked at had the author and title fields as read-only. 我首选的语言是Python,因此我寻找了一个Python库来执行此操作,我查看的每个库都将author和title字段设置为只读。

If Python doesn't have a library that works I am okay using VBA, VB.NET, JavaScript... I will take this as an opportunity to learn a new language. 如果Python没有可用的库,那么可以使用VBA,VB.NET,JavaScript ...我会以此为契机学习一种新的语言。

If you want to learn java you can use the Apache PDFBox 如果您想学习Java,可以使用Apache PDFBox

Here is an implementation example. 是一个实现示例。

Use Action Wizard in Acrobat X Pro. 在Acrobat X Pro中使用操作向导。

Create New Action. 创建新动作。

Setup Start With , and Save To step. 安装程序以开始 ,然后保存到步骤。

Set checkbox Overwrite existing files . 设置复选框覆盖现有文件

Select Content . 选择内容 Select Add Document Description . 选择添加文档描述

Left mouse click in option. 鼠标左键单击选项。 Uncheck Autor checkbox Leave As Is and enter new Autor name. 取消选中复选框作者日期 保留原样 ,然后输入新的名称作者日期。

Press Save button, set name action Your Action Name . 按“ 保存”按钮,设置名称为“ 您的操作名称”

Run Action: 运行动作:

File - Action Wizard - Your Action Name . 文件 操作向导 - 您的操作名称

I test it - work). 我测试了-工作)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM