Skip navigation
venkat4adobe
Currently Being Moderated

button tool

Jun 28, 2012 9:02 PM

hi,

 

can we able to  create doc level button in tool bar?i want to create custom sticky note tool in my pdf,how it is possible?

please help me

 

 

Regards

Venkat

 
Replies
  • George Johnson
    9,216 posts
    Aug 11, 2002
    Currently Being Moderated
    Jun 28, 2012 9:51 PM   in reply to venkat4adobe

    Yes. When you create a document-level button using app.addToolButton method, it creates a the button in a floating toolbar. Here's a link to the documentation: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_A croJS.88.134.html

     
    |
    Mark as:
  • George Johnson
    9,216 posts
    Aug 11, 2002
    Currently Being Moderated
    Jun 29, 2012 12:05 AM   in reply to venkat4adobe

    If you place the code in a function, you have to then call the function so that the code it contains is executed. For example:

     

    function addMyButton() {

     

        // Code to add toobar button goes here

     

    }

     

    // Call the function

    addMyButton();

     
    |
    Mark as:
  • George Johnson
    9,216 posts
    Aug 11, 2002
    Currently Being Moderated
    Jun 29, 2012 1:51 AM   in reply to venkat4adobe

    You should post all of the code you're using if you want more help.

     
    |
    Mark as:
  • George Johnson
    9,216 posts
    Aug 11, 2002
    Currently Being Moderated
    Jun 29, 2012 10:05 AM   in reply to venkat4adobe

    Why are you trying to add a menu item when you want to create a toolbar button?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 1, 2012 8:59 AM   in reply to venkat4adobe

    You can not add a menu item with a document script, menu items can only be added with a folder level script.

     

    addMenuItem

     

    addToolButton

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2012 11:30 AM   in reply to venkat4adobe

    You can only add one button when you call the app.addToolButton method. You need to call it twice changing the parameters as needed for each specific button.

     

    // add first button

    app.addToolButton({

    cName: "myButton1",

        oIcon: iconStreamObj,

        cExec: "app.alert('You have clicked the JavaScript toolbar button1.');",

        cTooltext: "This is my button1",

        nPos: 0

    });

     

    // add second button.

    app.addToolButton({

    cName: "myButton2",

        oIcon: iconStreamObj,

        cExec: "app.alert('You have clicked the JavaScript toolbar button2.');",

        cTooltext: "This is my button2",

        nPos: 0

    });

     

    Using the add button method as a document level script will create a floating button. It is a good practice to make sure you do not have duplicate tool bar buttons.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 25, 2012 11:12 AM   in reply to venkat4adobe
     
    |
    Mark as:
  • Currently Being Moderated
    Jul 26, 2012 6:29 AM   in reply to venkat4adobe

    You need to create an application folder level script that uses a function with the priviliged operation. See the

    Privileged versus non-privileged context and trustedFunction in the Acrobat JS API Reference.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 26, 2012 11:10 AM   in reply to venkat4adobe

    You can see all of the possible parameters for the addToolButton in the Acrobat JavaScript API Reference.

    Open the Navigation panel to see all of the Acrobat JavaScript documentation.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points