1 2 Previous Next 45 Replies Latest reply on Nov 8, 2016 8:59 AM by Bernd Alheit

    Adding a button with an icon -- RangeError

    rombanks Level 1

      Hello folks,

       

      I am working on a script that adds a custom button. Via a privileged function triggered thru a menu item, I can add a document-level script that creates this button.

      However, when I try adding an icon to the button, the debugger throws an error:

      RangeError: Invalid argument value.

      Doc.importIcon:1:Document-Level:Add_Button

       

      Here is my document-level script:

       

      this.importIcon("HomeIcon", "C:\\Test\\Home_Button.png", 0);

      var oIcon_Home = util.iconStreamFromIcon(this.getIcon("HomeIcon"));

      app.addToolButton({cName: "Home", cExec: "app.alert('Test Message')", cEnable: "event.rc = (event.target != null);", cTooltext: "Home Screen"});

       

      I suspect, Acrobat fails to access the C:\Test folder to create a PDF out of the icon file for some reason. Please, advise!

       

      Thank you in advance!

        1 2 Previous Next