[pdftex] [SOT] pdf in full screen mode on multiple screens
James Quirk
jjq at galcit.caltech.edu
Fri Oct 13 00:04:23 CEST 2006
> On 10/12/06, James Quirk <jjq at galcit.caltech.edu> wrote:
> > > Another (alternative) question: is there a way to send "Go to the next
> > > page" command simultaneously to all open pdf files?
> > This can be done using JavaScript, using code along the lines of:
> >
> > var docs = app.activeDocs;
> > for(var n=0; n<docs.length; n++) {
> > var doc = docs[n];
> > doc.pageNum++;
> > }
> >
> > But it will only work if each PDF has its "disclosed" flag set to true.
>
> How to add this code to PDF document: 1) using Acrobat 7? 2) Adding
> something to latex code?
> How to set disclosed flag? I do not see it in document properties?
>
It can all be done from within latex. For example,
you could use:
\pdfcatalog {
/OpenAction <<
/S /JavaScript /JS (
this.disclosed = true;
function bumpDocs(b) {
var docs = app.activeDocs;
for(var n=0; n<docs.length; n++) {
var doc = docs[n];
doc.pageNum += b;
}
}
)
)
}
Then you would use \pdfannot to define a widget that when clicked would
invoke the bumpDocs function. Note that if you're using hyperref, you will
need to suppress the pdfstartview option, otherwise it will add its own
OpenAction which may take precedence over the above, depending on the
ordering of the calls. I typically use:
\usepackage[pdfstartview=]{hyperref}
There are other details to consider, such as the 32K limit on the /JS ()
string, and the need to escape certain characters. Therefore you might
care to use the insdljs package, which comes with acrotex, to take care
of the details.
James
More information about the pdftex
mailing list