PDF印刷日期 [英] PDF date of print

查看:133
本文介绍了PDF印刷日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以显示查看/打印PDF文档的日期/时间?

Is it possible to show the date/time of viewing/printing of a PDF document?

我猜想它必须包含Adobe Java Script,但我不确定这是不是全部 可能的.

I guess it has to involve Adobe Java Script but I'm not entirely sure this is at all possible.

我确实有Acrobat X Pro,并且可以确定将使用Acrobat Reader 9或Acrobat Reader X打开pdf.

I do have Acrobat X Pro and I can be sure the pdf will be opened with Acrobat Reader 9 or Acrobat reader X.

嵌入一些其他信息肯定是一个加分(例如,文档的路径或存储在PDF属性中的作者姓名).

Embedding some other information would definitively be a plus (like the path the document or the name of the author as it is stored in the PDF properties).

有人做过类似的事情吗?

Anyone already did something similar?

推荐答案

是的,可以使用Acrobat JavaScript.您在页面上要显示日期/时间的位置上创建一个文本字段,并将其可见性设置为HiddenButPrintable.然后添加DocumentBeforePrint操作,并编写将字段值设置为当前日期/时间的javascript代码.该操作将在文档打印之前执行.这在Adobe Reader和Acrobat中可以使用,但是如果使用某些不支持JavaScript的工具打印文档,则日期/时间将不会出现.
之前打印操作的代码如下所示:

Yes, it is possible using Acrobat JavaScript. You create a text field on the page at the location where you want the date/time to appear and set its visibility to HiddenButPrintable. Then add a DocumentBeforePrint action and write the javascript code that sets the field value to current date/time. The action will be executed before the document is printed. This works in Adobe Reader and Acrobat but if you print the document with some tool that does not support JavaScript, the date/time will not appear.
The code for the before print action looks something like this:

getField("yourfield").value = util.printd("yyyy/mm/dd",new Date());

这篇关于PDF印刷日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆