I'm using the Javascript API built-in to the Adobe Acrobat products, and trying to access the doc.pageWindowRect
attribute.
I originally found that doc.pageWindowRect
was undefined whenever I tried to access it, and through various posts on the AdobeUsers forum, found that I needed to activate the media extension first, by running something like console.println(this.media);
Normally this prints a result like: [object DocMedia]
However, on some computers used by our client, this just prints undefined
instead. It seems that having this.media
remain undefined means that doc.pageWindowRect
will stay undefined too.
Does anyone know how to make sure this.media
is defined, and thus enable doc.pageWindowRect
? Or any other way of getting hold of the doc.pageWindowRect
information?
I wondered if there might be a delay in activating the media extension (a suggestion I found online), and have tried repeatedly running code to display this.media
and doc.pageWindowRect
using app.setInterval
, but even after waiting for a couple of minutes, they are still not defined.
Any suggestions would be greatly appreciated.
pageWindowRect
belongs to themultimedia.api
plugin. In Acrobat 9 and possibly other versions, this plugin is not by default loaded.From what I can find in that scenario, one method for loading the multimedia.api plugin is to actually have media in the PDF file.
Default location for this plugin is:
%Program Files%\Adobe\Reader 11.0\Reader\plug_ins\Multimedia.api
This might not be the fixing answer, but I hope the suggestion gives some insight. Good luck!