Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adobe Reader plugin interaction through Javascript

I'm displaying PDF file that are generated on-the-fly within a ASP page. The PDF generation (and download to the client) can take some time and I'd like to provide the user with some feedback (a loading message or something).

AFAIK there's no way to know when the PDF is viewed because the DOM events get triggered when the Adobe Reader plugin gets loaded (even though it's not displaying anything yet).

I noticed that there's a Javascript API for the plugin object that I could potentially use. I notivced a LoadFile method on it but unfortunately it doesn't seem to do much. Adobe's documentation is really useless. It talks of Javascript only as a plug-in writting language or as OLE interaction (and poorly).

Is there any documentation for the API and is it possible to know when the PDF has been loaded? It would be perfect if I could pass on a PDF stream to a PDF viewer of some sort.

like image 788
R4cOOn Avatar asked Aug 07 '09 12:08

R4cOOn


People also ask

Does Adobe support JavaScript?

Acrobat and Acrobat Reader let you adjust application behavior so that JavaScript executes within your desired level of security.

How do I use JavaScript in Adobe Acrobat?

The JavaScript debugger in Acrobat lets you review your code line by line, set breakpoints, and inspect variables using the debugger dialog. To enable JavaScript Debugger, go to Edit > Preferences > JavaScript, and then select the Enable JavaScript debugger after Acrobat is restarted option.

How do I enable JavaScript in Adobe Reader?

Choose Edit > Preferences (Windows) or Acrobat / Acrobat Reader > Preferences (Mac OS). From the Categories on the left, select JavaScript.

Can PDF execute JavaScript?

A JavaScript action allows execution of JavaScript code embedded in the PDF document. Essential PDF supports adding JavaScript action to the PDF document in the following: Document level JavaScript action.


1 Answers

I've wanted to the same, found a page that may help you out. http://www.adobe.com/devnet/acrobat/javascript.html

like image 153
almog.ori Avatar answered Sep 20 '22 11:09

almog.ori