How to execute acrobat javascript thorugh acrobat plugin???

I need to perform a task using javascipt...but i am not able to run javascript from my plugin...I tried it using AFExecuteThisScript method given in  API but it asks for " _gAcroFormHFT"..How can i import HFT into my plugin???
Is there any other method to execute a javascript from acrobat plugin??

You need to declare a (global) variable something like:
HFT gAcroFormHFT;
Then initialise it in your plugin's PluginImportReplaceAndRegister method, something like:
ACCB1 ASBool ACCB2 PluginImportReplaceAndRegister(void)
gAcroFormHFT = Init_AcroFormHFT;
return true;

Similar Messages

  • How to access Acrobat Plugin using GetInterface?

    Hi
    I'm trying to access a C++ plug-in written for Adobe Acrobat from a C# program. Following is my code, which I found elsewhere in this forum (LINK).
    Type acroApp;
    acroApp = Type.GetTypeFromProgID("AcroExch.App");
    object oAcroObject = Activator.CreateInstance(acroApp);
    object[] param = new object[1];
    param[0] = "MyPlugin";
    object pluginRef = oAcroObject.GetType().InvokeMember("GetInterface",BindingFlags.Invoke Method, null, oAcroObject, param);
    Here, MyPlugin is the name of the plugin (without extension) which I've placed in the Acrobat plug-ins folder. But this way, InvokeMember returns a NULL object instead of the expected interface of my plugin.
    What am I doing wrong? Any help would be greatly appreciated.

    You don't do it that way.
    You need to use standard "inter application communication" methods such as (but not limited to): COM, DDE, shared memory, shared files, named pipes, etc.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Wed, 1 Feb 2012 20:20:23 -0800
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: How to access Acrobat Plugin using GetInterface?
    How to access Acrobat Plugin using GetInterface?
    created by Sachintha81<http://forums.adobe.com/people/Sachintha81> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4180327#4180327

  • How to execute a javascript directly from a c++ plugin?

    I have created a photoshop plugin. I need to execute a javascript from the plugin itself. I am able to execute the script if I write the script in a seperate jsx file and execute it using its path(filename). But I need a method to execute script if that script is there as a string within the plugin code. Thanks 

    Hi,
    On what data 'ExecuteScript' works?
    Could you develop a filter which creates layers, applies on them some actions using Photoshop's filters (Using 'ExecuteScript') and then continue to work on them?
    Thanks.

  • How to export acrobat plugin as a COM component

    Hi all,
    I want to export acrobat plugin and its methods as a COM objet so i could be possible to call methods from ouside of acrobat.
    Please give me any solution. I am not sure that whether it is possible or not. I am not getting any correct way to implement this.
    Please help me.

    Hi,
    maybe you should create com-object wich will call acrobat plugin via LoadLibrary ot GetModuleHandle?
    OR
    http://forums.adobe.com/thread/580494?tstart=0

  • How could execute acrobat plug-in in command line?

    I am using acrobat plug-in to develop my own application.
    But I don't want to launch acrobat plug-in feature through acrobat menu item.
    Is it possible to launch acrobat plug-in(.api) with command line or outside acrobat?

    There is no way to do it from the command line, but you can establish
    whatever form of IAC/IPC between your plugin and your external application
    as you wish.  COM - DDE - IPC - named pipes - shared memory - shared files
    - etc....

  • How to execute My Javascript code from command line or through perl or VB

    Hi Forum,
    I am a new bie, just 2 days old to acrobat and javascript, and I am basically a perl developer
    Here with I have created a small script to merge two pdf
    // Create a new PDF document:
    var newDoc = app.newDoc();
    // Insert doc1.pdf:
    newDoc.insertPages({
    nPage : -1,
    cPath : "/d/sathish/1.pdf",
    // Insert doc2.pdf:
    newDoc.insertPages({
    nPage : newDoc.numPages-1,
    cPath : "/d/sathish/2.pdf",
    // Save the new document:
    newDoc.saveAs("/d/sathish/myNewDoc.pdf");
    My code is working fine and merging properly,
    Is there any way to execute this script through commandline or using some other scripting languages like perl or through VB
    My objective is to automate the merging process without any manual intervention, I don't want to open acrobat manually to execute this javacript, i want to automate that process too,
    Please suggest me which will be very helpful to me,
    Thanks in advance
    Thanks & Regards
    Sathish V.

    Hi Sathish,
    did you find a solution for this? I am looking for the same thing. I want to write a program(perl, batch script, etc.) which could automatically convert pdf to excel without any manual intervention.
    I have the acrobat javascript which could achieve this, but it can only be executed in arobat consolt.  I need it to be able to get executed in a script to automate the processing.
    thanks
    Warren

  • How to execute a JavaScript associated with an interactive field?

    I need to perform a virtual click from a plugin. Let's say that a set of 3 check box/radio button fields have the export values:
    - Yes
    - No
    - Maybe
    I have a script that says that the user virtually clicked on the "Maybe" button. All I have to do is find which of the radio buttons:
    radioButton#0
    radioButton#1
    radioButton#2
    contains the "Maybe" export value. So far, this task is very doable. My question is how to perform the following:
    I need to call the JavaScript interpreter and execute it, using as an argument the JavaScript code associated with the up mouse even of the button.
    Any help will be most appreciated...
    TIA,
    -Ramon

    IF you are trying to do this from a plugin - I would just use Cos APIs to get the appropriate JS from the field's action dictionary  and then pass it to AFExecuteThisScript().

  • How to execute a javascript function in the body onload?

    Hi everyone!
    As you know in the HTML body attribute. You must specify the value of onload
    What is the correct sintaxis for execute a function since in the onload body?
    I only want to do some like this, but only I do it in APEX:
    <body onload ="javascript:namefunction();" >
    I do not know how to use #ONLOAD# when you using want to set some value.
    Could u help me please ?
    Any help would be very appreciated.
    Thank u in advance
    Best Regards

    Hi Chris
    Thank you for your help
    I tried with the next code but it doesn´t work.
    Do you know for what?
    Best Regards
    I paste the next code in the HTML Header :
    <head>
    <script language="JavaScript" type="text/javascript">
    function addLoadEvent(func){
    var oldonload = window.onload;
    if (typeof window.onload != 'function'){
    window.onload = func;
    else {
    window.onload = function() {
    oldonload();
    func();
    function ejecuta()
    doSubmit('ACEPTAR_R')
    addLoadEvent( ejecuta );
    </script>
    </head>

  • Call JavaScript function from Acrobat Plugin

    Hi All,
    I want to call JavaScript function from Acrobat Plugin? Where is to write JavaScript function in Acrobat SDK? Please reply..
    Thanks in advance..

    Hi Malkyt,
    Thanks.. where is to write JavaScript code in the application..
    function GetWelcome()
    alert("Welcome");
    this above code. how to use this javascript code to plugin application.
    static ACCB1 ASBool ACCB2 AVPageViewMouseClick (AVPageView pageView, AVDevCoord xhit, AVDevCoord yhit, AVFlagBits16 flags, AVTCount clickNo, void *data)
    char jsscript[200];
    AFExecuteThisScript (pddoc, jsscript, NULL);
    i want to display welcome message of JS file.. give me step to perform above task.. Please reply...

  • How to read text and it's font details (Family and size) using Acrobat plugin?

    Hello,
           I have query about reading PDF, I wanted to extract text and it's font details (Family and size) using Acrobat plugin. How can I achieve that?
    Any suggestions are welcome.
    Thanks
    Rohit Shinde

    Look at the samples in the SDK around PDFEdit and the PDEdit APIs.

  • How do I install the Acrobat Plugin in Safari?

    How do I install the Acrobat Plugin in Safari?

    Hi Gaspar,
    With the Acrobat 10.1.3 update, we fixed the PDF-viewer for Safari 5.1.x.  Make sure your Acrobat is up to date via Help > Check for Updates.
    -David

  • Acrobat plugin, "external" links - how to open in _blank?

    I understand that the following questions may have been asked numerous times on this and other forums previously. Knowing that software capabilities constantly change with every new release, I wanted to clarify by gaining answers directly to the following questions.
    If a PDF document is displayed within the acrobat plugin in any web browser, is it possible to invoke a link within that PDF to open in a new browser window or tab rather than loading in the current window and navigating away from the PDF?
    Is there a cross browser solution for achieving this outcome?
    Our workflow for producing PDFs involves Indesign, is there a way we can implement this in the Indesign source by inserting Javascripts?
    If the answer to (1) and (2) is "No", are there any alternative options for achieving this?
    Any constructive insights/suggestions are greatly appreciated.

    I think part of your problem might lie in the way you are trying to use your quotation marks.  It appears you are trying to have the single quotes do what double quotes should be doing.
    document.write("<a href='"+imagelinks[ry]+"' target='_blank'><img src='"+myimages[ry]+"' border='none'></a>
    If you want to have doublequotes appear in code as doublequote characters you can try slashing them to have them read literally... \"
    document.write("<a href=\""+imagelinks[ry]+"\" target=\"_blank\"><img src=\""+myimages[ry]+"\" border=\"none\"></a>

  • How to execute javascript code in VBScript?

    I'd like to execute similar javascript code for some particular PDF files(parameters for pagenumber are quite different),such as:
    this.setPageLabels(0, [ "A", "", 3] );
    this.setPageLabels(1, [ "r", "", 1] );
    this.setPageLabels(16, [ "D", "", 1] );
    How to write the code in VBScript?
    Thanks in advance!
    P.S. I try to add code but end up with error messages
    =================================================================
    path = "E:\test.pdf"
    '//Write the first and last pagenumbers and label to a txt.
    set oWs = CreateObject ("Wscript.Shell")
    set fs = CreateObject("Scripting.FileSystemObject")
    oWs.run "Acrobat.exe"
    While not oWs.AppActivate("Adobe Acrobat") : Wscript.Sleep 1000 : Wend
    Set objArgs = WScript.Arguments
    if objArgs.Count = 1 then path = ObjArgs(0)
    Set gApp = CreateObject("AcroExch.App")
    Set AVDoc = CreateObject("AcroExch.AVDoc")
    If (AVDoc.Open(Path,"")) Then
    Set AVDoc = gApp.GetActiveDoc()
    Set PDDoc = AVDoc.GetPDDoc()
    Set JSO = PDDoc.GetJSObject
    '// Write Bookmark JS to a variable
    Ex = " var vTOC = """"; "&vbLF _
    & " var s = """"; "&vbLF _
    & " var i=0; "&vbLF _
    & " p = i+1; "&vbLF _
    & " vTOC += ( this.getPageLabel(i) +""|""); "&vbLF _
    & " i= this.numPages-1 ; "&vbLF _
    & " p = i+1; "&vbLF _
    & " vTOC += ( this.getPageLabel(i) +""|""+p+""|""); "
    ' // Execute the JavaScript
    Set AForm = CreateObject("AFormAut.App") 'from AFormAPI
    AForm.Fields.ExecuteThisJavaScript EX
    ' // Write Bookmarks to CSV (PageNr;Level;Text)
    Set JSO = PDDoc.GetJSObject '//->renew JSO for some unknown reasons
    xf = jso.vToc
    Set objIE = CreateObject("InternetExplorer.Application")
    objIE.Navigate("about:blank")
    objIE.document.parentwindow.clipboardData.SetData "text", xf
    objIE.Quit
    CsvFN = left(path, InstrRev(path, ".")-1) &"_page.txt"
    set FL = fs.OpenTextFile(CsvFN, 2, true) '//-> 2=ForWriting
    xWr = split(xf,"|")
    for x=0 to UBound(xWr)
    FL.WriteLine xWr(x)
    next
    FL.Close
    Else
    MsgBox "Failed to Open: " & Path
    End If
    Set JSO = Nothing
    Set PDDoc = Nothing
    Set AVDoc = Nothing
    Set AForm = Nothing
    Set gApp = Nothing

    If I remember right, I wrote this script a while back to demonstrate how java script can be direct executed and how you can get back the results. Didn't I wrote a commentary to that?
    However the parts you need:
    ' // Write JS code from help file or whatever to a VBS variable:
    JsFromHelp = " this.setPageLabels(0, [ ""A"", """", 3] ); "&vbLF _
    & " this.setPageLabels(1, [ ""r"", """", 1] ); "&vbLF _
    & " this.setPageLabels(16, [ ""D"", """", 1] ); "
    ' // Execute the JavaScript
    Set AForm = CreateObject("AFormAut.App") 'from AFormAPI
    AForm.Fields.ExecuteThisJavaScript JsFromHelp
    From the rest keep only:
    end if
    set .. = nothing
    Untested, but should work - as far as you have a little bit more then only Reader.
    HTH, Reinhard

  • Acrobat plugin sdk query

    Hi All,
    when i use acrobat sdk plugin sample in MS VS2005, it is asking "Please specify the name of the executable file to be used for the debug the session", I am not much understand about that, could some one help for, to understand how to use the acrobat plugin sdk's.
    -Thanks.

    you can run the SDK by first building the project, after successful build go to the debug folder u ill find an api generated, copy the api and paste in the Plug-in's folder(you will find this folder in the source path where you have installed your acrobat software) after pasting run the acrobat.exe you will find your plug-in installed(Normally when you run the sample plug-in you will find the plug in installed in Advanced>>Acrobat-SDK)

  • How to execute javascript file on event..

    Hi... I made a template form. After filling it, when user press the button, i want to execute a javascript code which is in a .js file. What do I have to write in the code related to the button? Thanks

    Acrobat JavaScript has some unique objects, properties, and methods that are unique to Acrobat. Adobe has poset a number of documents deatiling the Acrobat's JavaScript.
    JavaScript for Acrobat: http://www.adobe.com/devnet/acrobat/javascript.html
    Acrobat Documentation: http://www.adobe.com/devnet/acrobat/?view=documentation
    The location of the application folder, depends upon the OS and Acrobat/Reader version.
    Use or a folder level JavaScript, requires the JS file to be installed on each client computer
    To impliment a counter there are a number of ways. The easiest is to use a 'global' 'subscribed' variable. See the August 2004 (issue 34) of the Acument Traing Journal, http://www.acumentraining.com/acumenjournal.html, for information about how to do this.
    One can also use the ADBC, Adobe DataBase Connection or a submit to a web server script page to obtain data from a file.
    If you want to read and write a file in Acrobat/Reader there are a number of restrictions.

Maybe you are looking for

  • Can i sync an iphone 4 and a ipad 2 with the same itunes library?

    can i sync an iphone 4 and a ipad 2 with the same itunes library?

  • Itunes does not recognise ipad or iphone after window 8.1 patch May 2014

    Last week my laptop did a patch update to windows 8.1 and now  Itunes does not recognise  my ipad or iphone when i plug them into the USB ports. The devices do ask "to trust the computer" and Windows itself reconises the ipad and iphone and i can get

  • Asset cost transfer.

    Hi, I wanted to reclassify certain amount from 188000 (goodwill a/c) to 189000 (Intangible asset a/c) in company 5000. We donu2019t want to set up the depreciation(Dep. should not be calculated) u2013 only want to add value to account 189000. How can

  • How to configure event based ALEAUD?

    I am sending idocs from BPM to R/3, and would like to know, whether it is possible to get ALEAUD confirmations back to XI in real time.  At present it takes about 10 minutes to get the ALEAUDits back, and that will withhold my BPM in idle.

  • Progressive download and drag

    Hi, I'm having a problem with my Flash player and hope this is the correct forum for this query. I am using a progressive download (no FMS available sadly) and when I try to skip forward (by dragging the seekbar handle) to a place in the video where