4 Replies Latest reply on Jan 20, 2011 3:31 AM by VCAIT

    Update JavaScript to work with Acrobat 8

    VCAIT

      A predecessor created the following JavaScript to add a menu i

      tem that inserts a background image.  This works in Acrobat 7 but only in Acrobat 8 if Acrobat 7 is or was installed previously, clean installs of Acrobat 8 and the script does nothing.

       

      Is there anything that needs to be changed in the script for it to work with new installs  of Acrobat 8?

       

      //add background function
      background=app.trustedFunction (
      function ()

      app.beginPriv();

      this.addWatermarkFromFile({
      cDIPath: "/c/invoice/invoice.pdf",
      bOnTop: false,
      nHorizAlign: app.constants.align.center,
      nVertAlign: app.constants.align.middle,
      nOpacity:100;
              });

      app.endPriv();
      });

      //Add functions to menu
      app.addMenuItem({cName: "Add invoice background", cParent: "Document", cExec: "background()",cEnable: true, nPos: 1});

      Thanks