views:

56

answers:

2
+1  Q: 

Tracking thru PDF

If i am exporting a document in PDF and kept in public so that any users can download and read it. Now i want to track this. How many times the PDF got opened.

Note that my question is not to track while i download, we need to track when the PDF is opened. Is there any kind of script that is invoked when the PDF is opened so that acrobate sends the details to my server?

Following details i need.

1) IP 2) Date/Time 3) Possbilly GEO Location.

+1  A: 

Yes, you can probably do this. PDF includes a Javascript API, which some (but not all) PDF readers implement. I'm only certain of Acrobat and Foxit Reader doing this, and it can be turned off in both, for security and privacy reasons. That said, it's probably your best shot.

I glanced through the Javascript for Acrobat API Reference, and it looks like you could register for the "Page/Open" event (page 368 in my copy), and on receiving the first one of those, make a Net.HTTP call (page 548) to a web server you're running. That will get you the date/time and the public IP of the client reading the document, from which you can get a geolocation using a service like GeoIP.

Warren Young
A: 

I'm not sure this is possible. Although PDF can execute Javascript, reader software is naturally paranoid about malware being embedded in "benign" documents, so the execution context is quite restricted, with warnings shown about possible dangerous activity.

See previous SO question Can my PDF ping my server when it is opened?

Ned Batchelder