Skip navigation
Currently Being Moderated

To draw in the pdf using pen tool in acrobat reader x

Mar 5, 2012 5:55 AM

hi im using the app.execMenuItem("Annots:Tool:InkMenuItem"); in the javascript of textbox in acrobat pro 9. When i click the text box pen tool is activated and im able to sign in that textbox.

 

But in acrobat reader 10.1.2 when i click the textbox its not working . i.e (app.execMenuItem("Annots:Tool:InkMenuItem"); ) is not executing . Is there any other command to get pen tool in acroabat reader x.

 
Replies
  • Currently Being Moderated
    Mar 5, 2012 6:10 AM   in reply to sachinprasad

    Couple of issues there:

    1. Your code should not work at Acrobat Pro 9 at all, unless you've edited the registry and added this menu item to the white-list, or you're actually calling it from a trusted function in a folder-level script.

    2. The menu items in Acrobat and Reader X have changed dramatically. You need to make sure that this item is still available through the menus, and that its name has not changed.

    3. If commenting for the file in Reader is not enabled, its possible that this menu item could not be executed at all there.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2012 6:39 AM   in reply to sachinprasad

    Sorry, I'm not following you...

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2012 7:32 AM   in reply to sachinprasad

    If you're already using the "Execute a menu item" command, why do you need a JavaScript code to do the same?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 6, 2012 1:30 AM   in reply to sachinprasad

    Execute a Menu Item is not working because these menu items no longer

    exist. Therefore, doing the same with JS code won't work either...

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 6, 2012 2:03 AM   in reply to sachinprasad

    The two are not related. This code adds some annotations to your file. The

    code you want to use needs to select a tool from the GUI.

    It has nothing to do with each other.

     
    |
    Mark as:
  • Thom Parker
    216 posts
    Jul 16, 2003
    Currently Being Moderated
    Mar 9, 2012 9:33 AM   in reply to sachinprasad

    Yes, there is.  And your code is correct.  If you run that code from the console window you will see that it works.  The problem is that menu item cannot be generally run from a non-privileged context. They have to be on a white list. In windows this is a registry setting:

     

    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Adobe\Adobe Acrobat\8.0\FeatureLockDown\cDefaultExecMenuItems

     

    On the Mac it's in a setting file.

     

     

    Thom Parker
    The source for PDF Scripting Info
    pdfscripting.com

     

    The Acrobat JavaScript Reference, Use it Early and Often

     

    Then most important JavaScript Development tool in Acrobat
    The Console Window (Video tutorial)
    The Console Window(article)

     
    |
    Mark as:
  • Thom Parker
    216 posts
    Jul 16, 2003
    Currently Being Moderated
    Mar 17, 2012 10:01 AM   in reply to sachinprasad

    Sorry it took me a while to get back to this thread, been busy. 

     

    For obvious security reasons a PDF script cannot modify the registry.  Acrobat JavaScript is very well protected.  However, you can save the registry settings out of the registry editor to a ".reg" file.  When the user clicks on this file, Window's knows to import the settings.   In the registry editor, look on the File menu for the "Export" entry. 

     

    Ideally you could make this *.reg file an attachment to a PDF and then use a script to launch it, but I don't think this will work.  There are a number of file extensions that Acrobat will not export. I wouldn't be suprised if *.reg was one of them. So you may have to pass this file around in a zip, or create a windows installer file.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 30, 2012 7:31 AM   in reply to sachinprasad

    Moving this discussion to the Acrobat JavaScript forum.

     
    |
    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