PDF date of print

Deadly 提交于 2019-12-11 04:22:31

问题


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

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

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

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?


回答1:


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());


来源:https://stackoverflow.com/questions/10351952/pdf-date-of-print

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!