JAVASCRIPT   122
AcroReloadPDF js
Guest on 9th March 2023 01:38:51 PM


  1. ////////////////////////////////////////////////////////////////////////
  2. //
  3. // AcroReloadPDF.js, version 20090202
  4. //
  5. // * folder level JavaScript, to be put to:
  6. //
  7. //   $HOME/.adobe/Acrobat/8.0/JavaScripts
  8. //   (version number might need to be adjusted)
  9. //
  10. // * adds item ``Reload'' to the ``File'' menu of Adobe Reader
  11. // * reloads the current document and restores page number and zoom
  12. //   state
  13. //
  14. // Alexander Grahn
  15. //
  16. // This material is in the Public Domain.
  17. //
  18. ////////////////////////////////////////////////////////////////////////
  19.  
  20. reloadCurrentDoc=app.trustedFunction(function(currentDoc){
  21.   app.beginPriv();
  22.   var currentDocView=currentDoc.viewState;
  23.   var currentDocPath=currentDoc.path;
  24.   currentDoc.closeDoc();
  25.   currentDoc=app.openDoc(currentDocPath);
  26.   currentDoc.viewState=currentDocView;
  27.   app.endPriv();
  28. });
  29.  
  30. app.addMenuItem({
  31.   cName:   "reloadCurDoc",
  32.   cUser:   "Reloa&d",
  33.   cParent: "File",
  34.   cExec:   "reloadCurrentDoc(event.target);",
  35.   cEnable: "event.rc = (event.target != null);",
  36.   nPos:    "Open",
  37.   bPrepend: true
  38. });

Raw Paste

Login or Register to edit or fork this paste. It's free.