summaryrefslogtreecommitdiff
path: root/support/acroreloadpdf/AcroReloadPDF.js
blob: b79204c68ec8a34257f5340b360b76f66fb84446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
////////////////////////////////////////////////////////////////////////
//
// AcroReloadPDF.js, version 20090202
//
// * folder level JavaScript, to be put to:
//
//   $HOME/.adobe/Acrobat/8.0/JavaScripts
//   (version number might need to be adjusted)
//
// * adds item ``Reload'' to the ``File'' menu of Adobe Reader
// * reloads the current document and restores page number and zoom
//   state
//
// Alexander Grahn, 2009
//
// This material is in the Public Domain.
//
////////////////////////////////////////////////////////////////////////

reloadCurrentDoc=app.trustedFunction(function(currentDoc){
  app.beginPriv();
  var currentDocView=currentDoc.viewState;
  var currentDocPath=currentDoc.path;
  currentDoc.closeDoc();
  currentDoc=app.openDoc(currentDocPath);
  currentDoc.viewState=currentDocView;
  app.endPriv();
});

app.addMenuItem({
  cName:   "reloadCurDoc",
  cUser:   "Reloa&d",
  cParent: "File",
  cExec:   "reloadCurrentDoc(event.target);",
  cEnable: "event.rc = (event.target != null);",
  nPos:    "Open",
  bPrepend: true
});