code app.addToolButton

I have a form that has parameters specific print based on the user at the beginning of the form input

My question is twofold

The code below (just the stuff this.print) works fine if I place a button, but the button placement is fixed and personnel may be missing if they scroll beyond page 1

I tried the code in the actions of Document Set - Document will be printed - but it did not work

I tried to create a tool button (complete code below)

It works a little and a little bit not.  It creates the button and this button is available a short matter what personnel is on the page - large but it's ugly.  Is there a way to make it look better than just this window javascript or better yet is there a way to make just a normal button float with scroll or be docked on the side like the toolButton - if this isn't a BIG DEAL

My biggest problem is that it.

When my open form, it comes up saying document tries to print you want to allow - I hit No. It then creates the button of my tool.  Which when I click - Print then

I want not to have to ask if I want to print, I don't want that to happen IF I click on

I know not part of the problem is the function at the beginning, but I don't know how to fix

I have to create the toolbar button, but how do the function works only when you click on this toolbar, since the code is at the level of the document

I just want a way to have the printable form and not need to have staff to 'think '.

what setting I'm looking for
var email = this.getField("FormValues.emailAddress_0").value

create the function that I want executed when you press

cButtJS Function() {}
If (' email! = "") {}
This.Print ({}
bUI: false,
bSilent: true,
bShrinkToFit: true,
Start: 0,
nEnd: 2
});
}
ElseIf (email =="") {}
This.Print ({}
bUI: false,
bSilent: true,
bShrinkToFit: true,
Start: 0,
nEnd: 15
});
}
}

turn on the switch

app.addToolButton ({cName: "PRINT CSHARES", cLabel: "CLICK HERE to print Document", cTooltext: "", cExec: "cButtJS"});

You have some errors related to the definition of the function and the call.

1. all of the code (with the exception of the addToolButton command) should be inside the function. I am referring to your first line of code, for the most part.

2. the correct way to define a function is:

function cButtJS() {}

... code

}

3. the correct way to call a function (the parameter cExec) is:

cButtJS();

Tags: Acrobat

Similar Questions

  • Replace the file cod app already on the review for approval

    Hi, I submitted my application for approval a week ago and during the waiting time (this week), I found a critical error on my application, so I quickly got it repaired. However, the application form wouldn't let me exchange the cod file. I need to change it before it arrives on the app world, so that users would not complain about this!

    Please tell me how to swap the file cod prior approval or a person to contact about this problem. Much help is greatly appreciated!

    If there is absolutely no way to swap or person to contact, can PS I cancel the application for approval and submit a new application?

    Once your application is approved, you get an option for post-it for sales. You are not required to post immediately for sale, so you can submit another version for approval. Updates are approved more quickly (day or both) and after that, you can validate the app for sale.

  • Userinit.exe error code - app.

    Userinit.exe - application error when I try to start up until I do I just reinstalled xp and all packs is 1-3 and now I can't even get in the log in help.

    Hello

    · You receive an error with the error code?

    · What is the number and the model of the computer?

    This problem occurs if the Userinit key in the Windows registry has been changed or if there are incorrect shell registry settings.

    Try the steps listed below and check if it helps:

    Important: the instructions below are steps that tell you how to change the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information, view the article in the Microsoft Knowledge Base: How do I back up and restore the registry in Windows: http://support.microsoft.com/kb/322756

    a. press CTRL + ALT + DELETE, and then click Manager tasks.

    b. on the file menu, click New task (run...).

    c. type regedit and then click OK.

    d. in the left pane, look for, and then click the following registry subkey:

    e. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

    f. in the right pane, double-click Shell.

    g. in the value data box, type Explorer.exe, and then click OK.

    h. in the right pane, double-click Userinit.

    i. in the value data box, type % windir%\system32\userinit.exe, and then click OK.

    Note the placeholder % windir % represents the path of the Windows folder. By default, C:\WINDOWS is the path of the Windows folder.

    j. If you type an incorrect value in the value data box, you cannot connect to the Windows XP-based computer.

    k. exit from the registry editor.

    a. restart the computer.

  • Cod app and library can be for different platform versions?

    I am writing an application that must run on a wide range of versions of the device. Some of the application contains code depending on the version, but a little is independent of the version. Are there problems or special considerations for structuring an application as a main .cod file compiled for a specific platform version and a .cod of library which contains functions of "lowest common denominator" compiled for, say, 4.2.1?

    What you propose works OK for us.

    The library is developed in a different project and workspace, the "interface" between the use of the application and the library is the jar file, which is imported into dependent projects.  This means that the two become completely independent, and it is possible to exchange the library for a later version on the device, without changing the main cod.

    The biggest problem is multiple applications with the same shared library requiring different versions of this library.  This section of the shared library has been discussed widely in the DevCon, so I hope that Rim will contribute to this requirement in some way in the future.

  • CS5 glue code - app.scriptPreferences.version =?

    As already reported here (http://forums.adobe.com/message/3624710) included in CS5 glue code.jsx affects the Version scriptPreference 6

    I'm not how I prefer to stick to a Script Version and mix 7 with 6 is confusion right now.

    It was mentioned that the wrong glue code version has been corrected with CS5.5 - but - I don't want to pay for CS5.5 (that I don't need). Is there a chance to get a working clue Version 7 code somewhere? Would be included in CS 5.5 glue code work with CS5 too or is the full implementation of RuleProcessor simply not to lend when they sold CS5? Can anyone tell me please where I could get from (if it would work)?

    Thanks, Joerg

    InDesign CS5, Mac

    As stated in the thread that you accessed, you can simply comment out or remove this line, leaving the scriptPreferences.version to 7.0, without ill effect.

    Jeff

  • Work at the level of the Document, but not from addToolButton

    I have the code that works perfectly when I run level document Acrobat 8.0 Pro.

    When I try to put it on the app.addToolButton function I get undefined errors.

    Could someone review my code and I would like to know how to apply it correctly in a call to the addToolButton function?

    It works Document level:

    page var this.pageNum =;

    numWords var = this.getPageNumWords (page);

    for (var i = 0; i < numWords; i ++)

    {

    var ckWord = this.getPageNthWord (page i);

    var stringInt = parseInt (ckWord);

    function buttonLocation() {}

    var q = this.getPageNthWordQuads (page i);

    m = (new Matrix2D) .fromRotated (this, page);

    mInv = m.invert)

    r = mInv.transform (q)

    r = r.ToString)

    r = r.split(",");

    }

    function makeCalloutButton() {}

    var l = this.addField (('000'_+_ckWord).substr (-3) + "_callout", "button", page, [r [4], r [5], r [2], r [3]]);

    l.setAction ("MouseUp", 'this.callout' ('000' + ckWord).substr(-3) + "();");

    l.userName = "Location Machine";

    }

    function workMagic() {}

    buttonLocation();

    makeCalloutButton();

    }

    function doTaps() {}

    If (ckWord == 'AA') {workMagic() ;}

    If (ckWord == 'BB') {workMagic() ;}

    If (ckWord == 'CC') {workMagic() ;}

    }

    doTaps();

    }

    So, here is my code that work IS NOT the execution of the addToolButton:

    app.addToolButton({)

    cName: "tapssMaker", / / name of your button

    cExec: 'taps();', call //Function

    cLabel: "click on", //The text on the button

    cTooltext: "Please let me buttons" //The Help Text

    });

    function taps() {}

    page var this.pageNum =;

    numWords var = this.getPageNumWords (page);

    for (var i = 0; i < numWords; i ++)

    {

    var ckWord = this.getPageNthWord (page i);

    var stringInt = parseInt (ckWord);

    function workMagic() {}

    var q = this.getPageNthWordQuads (page i);

    m = (new Matrix2D) .fromRotated (this, page);

    mInv = m.invert)

    r = mInv.transform (q)

    r = r.ToString)

    r = r.split(",");

    var l = this.addField (('000'_+_ckWord).substr (-3) + "_callout", "button", page, [r [4], r [5], r [2], r [3]]);

    l.setAction ("MouseUp", 'this.callout' ('000' + ckWord).substr(-3) + "();");

    l.userName = "Location Machine";

    }

    function doTaps() {}

    If (ckWord == 'AA') {workMagic() ;}

    If (ckWord == 'BB') {workMagic() ;}

    If (ckWord == 'CC') {workMagic() ;}

    }

    doTaps();

    }

    }

    The code you posted seems very well (with the exception of the reference to the document

    object, but it should still work). What exactly is the problem with it?

    You can do much more compact by using this structure:

    If (ckWord == 'AA' | ckWord == 'BB' | ckWord == 'CC') {}

    rest of the code to create a link object

  • Error "app.addMenuItem is not a function".

    Hey,.

    New to Acrobat and Javascript in general.  I wanted to be able to create a custom toolbar with four buttons when a document is loaded (we don't want the buttons on the documents themselves), and I copied and pasted the following code in a module named "Open" to give me an example of how the controls work.  When I run it, I get the error in the title of the thread.  So I copied the first block of code - the "addMenuItem" command in the Javascript console and tried to run from there, and I get the same error.  Someone has an idea of what's going on here?  Thanks for any help you can give me.

    function() {return A.apply (null, [this] .concat ($A (arguments)))}


    //-------------------------------------------------------------
    -Do not change the tags XML-
    //-------------------------------------------------------------

    > to the document level.
    Open < ACRO_source > < / ACRO_source >
    < ACRO_script >
    / * belongs to: Document-level: open * /.
    var atbtoolbuttons;
    app.addMenuItem({)
    cName: "atbToolButtonSet."
    cUser: "my Menu."
    cParent: 'tools. '
    cMarked: "event.rc = ((typeof atbtoolbuttons! = "undefined") & &! atbtoolbuttons). "
    cEnable: "event.rc = (event.target == null);"
    cExec: 'loadATBToolButton();', NPO: 0
    });

    var loadATBToolButton = app.trustedFunction (function)
    {
    If (typeof atbtoolbuttons is "undefined")
    atbtoolbuttons = true;
    else {}
    If (! atbtoolbuttons) {}
    app.removeToolButton ("atbToolButton1");
    app.removeToolButton ("atbToolButton2");
    atbtoolbuttons = true;
    return;
    }
    }
    If {(atbtoolbuttons)
    app.beginPriv ();
    Get the path to the folder the user JavaScript
    var atbPath = app.getPath ({cCategory: Cfolders, "user": "javascript"});
    try {}
    Try to open the doc of the icon as in hidden mode and recover his doc
    object.
    var doc = app.openDoc ({}
    cPath: atbPath + "/ icon_toolbar.pdf" {, acachees: true}); ' "
    } catch (e) {console.println ("could not open file icon"); return ;}}
    Get the flow of the hidden myIcon1 of the doc icon
    var oIcon = util.iconStreamFromIcon (doc.getIcon ("myIcon1"));
    Add a tool button using this icon
    app.addToolButton({)
    cName: "atbToolButton1."
    oIcon: oIcon,.
    cExec: 'atbTask1();',
    cTooltext: "my toolbar button 1."
    NPO: 0
    });

    Download now myIcon2 of the document hidden.
    oIcon = util.iconStreamFromIcon (doc.getIcon ("myIcon2"));
    and install this toolbar and button
    app.addToolButton({)
    cName: "atbToolButton2."
    oIcon: oIcon,.
    cExec: "atbTask2()."
    cTooltext: "my toolbar button 2."
    NPO: 0
    });
    Close our document hidden with the icons.
    doc.closeDoc ();
    app.endPriv ();
    Set this variable to point out that the toolbars are installed.
    atbtoolbuttons = false;
    }
    })

    < / ACRO_script >
    < / at the level of the document >

    In the documentation, read the note for the addMenuItem method.

  • Deployment of OTA: multiple COD in a single JAD: NullPointer Exception

    Hi all

    I am trying to install application OTA. I managed to install for a single cod by changing JAD to point to the URL of the server. However, in my application, there are several files of COD and I want them all to be installed once. Therefore, based on the Knowledge Base Article I added

    RIM-COD-URL-n: >

    RIM-COD-size-n: >

    for all COD in single JAD files. Since I'm on signed code I updated param of size with the new file size of cod also.

    When I point to this URL of file JAD I get HTTP 500 error and watch details be java.lang.NullPointerException.

    Also I've added the project dependency while RIM-COD-Module-dependencies, although I tried without modification as well.

    Here's my full JAD file... I would like to know if I missed something...

    Manifest-Version: 1.0
    RIM-COD-Module-Name: SosAlert
    RIM-COD-Module-Dependencies: net_rim_cldc,net_rim_locationapi,Objects,ApplicationServices,net_rim_xml
    MIDlet-Jar-Size: 2071
    MIDlet-1: ,,
    RIM-COD-Creation-Time: 1216305305
    MIDlet-Jar-URL: SosAlert.jar
    RIM-COD-URL-1: http://serverip/temp/ExternalJarsLib.cod
    RIM-COD-Size-1: 33904
    RIM-COD-URL-2: http://serverip/temp/Objects.cod
    RIM-COD-Size-2: 6840
    RIM-COD-URL-3: http://serverip/temp/ApplicationServices.cod
    RIM-COD-Size-3: 4536
    RIM-COD-URL: http://serverip/temp/SosAlert.cod
    RIM-COD-Size: 3716
    MicroEdition-Configuration: CLDC-1.1
    MIDlet-Version: 0.0
    MIDlet-Name: SosAlert
    MIDlet-Vendor: 
    MicroEdition-Profile: MIDP-2.0
    RIM-MIDlet-Flags-1: 0
    

    Thanks adavance.

    You shouldn't list your individial modules in the section of RIM-COD-Module dependencies.  Here are a few questions that might help:

    1. one of your folders of cod are in fact several cod (app.cod to app.zip fame and trying to extract).  If they are each extracted cod should be included as separate RIM-COD-URL/size-N in the jad.

    2. is the configuration of your server with the correct mime types?  The mimetype to a jad should be text/vnd.sun.j2me.app-descriptor and the mimetype for cod should be application/vnd.rim.cod

    3. Once you get the NullPointerException check your event log by clicking on the home screen and pressing Alt-LGLG.  There may be an entry in the "BOLD" which refers to the NullPointerException and a stack trace.  This can give us an idea as to why this is happening.

    4. try the Simulator and see if the output of the Simulator has nothing relevant.

    Also, let us know what jde you build with and which model of device/OS you are using when you receive these errors.

  • Install problem COD file

    Hi all

    I know it's important to look for answers before posting and I spent several hours to do.  I found a few related messages, but the solutions did not resolve my problem.

    I have a J2ME application that is fully tested for the game.  It works fine when it is installed as a pair of jad/jar on each Simulator and device I've tried.  And the midlet icon appears in the interface of the phone, just as it should.

    The game uses no RIM specific libraries or modules.  As a jad/jar pair, the same build runs on dozens of non-blackberry devices.  The code in the jar detects that the phone is a blackberry using System properties and the game is its own minor configuration to look nice on a blackberry.

    The next step is to convert the application into a cod file and sign it.

    You use the JDE 6.0, I made a new project, imported the jad/jar and run the Build command.  The cod was created, and accordingly modified jad.  So far so good.

    I have my signature identification information, and once again, using the JDE, I ran request Signatures.  The interface reported success.  No problems.

    The cod file is 207 k and consists of 4 cod files.  I read the instructions for this case and unpacked the cod file in its 4 cod files.  App.COD, 1.cod - app, app - 2.cod, app3.cod.

    I've posted four cod files as well as the jad file on my server, the server apache even where I serve regularly jar/jad files.

    I have triple checked the mime types in the .httaccess file.  Mime types are correct for jar, jad and cod.

    I point the browser on the Blackberry 6.0.0.337 Simulator 9800 to the jad file.  I get the download window with the properties of jad and the download button.  I click Download.  If I do this a second time, I get the button replace, so the Simulator think that the file has been downloaded, in this case.

    It seems that the files are for download.  The watch cursor appears 4 times, probably once for each file in cod.  No errors.

    At the end of the download, I get a message "the application has been installed successfully" and an OK button.  But, no run button, as I get with the installation of the pot.  I click OK.

    I exit the browser and return to the main screen.  There is no download folder.  The game is not in the folder games or Applications.  If I go to Options/Applications, the game is not listed there.

    If I menu click the Options/Applications window, I get: JVM 104 Eception NullPointerException error.  However, I had not yet tried to run the application.  A stack trace turned up a few odd lines:
    UI - EUI no face is detected
    VM - BORK
    However, I do not know what generated those lines or when.

    By the way, I also tried to download the full 207 k cod or in this case, I get the 907 error expected because the jad file is referencing files of cod that the server could not find as separate files.

    I also tried to download other simulators, for example 5.0.0.54 5 9700.  As above, the files seem to download very well and I get the message: "the application has been installed successfully" and an OK button.  On this Simulator, there is a download folder, but it is empty.  The game is not in games or in the Applications folder.

    On this Simulator, I go in the Options/Applications, and there is an entry for my game.  The title of the game is OK, but there is no icon.  I opened the entry and get title properties and a delete button.  There is no run button.  It shows the installed date and another button for the properties of the Module.  It also shows the size correctly and the signatory IDs.

    I also tried this procedure on a physical device, the AT & T 8300.  I had the same behavior as the 9700 Simulator.  Again, there is no problem with installation of the jad/jar.  The problem is with the jad/cod/COD-1/cod-2/COD-3

    Why is - this game appearing to successfully download and install successfully but apparently not be installed can thus be run?

    Thank you for your time.
    Alan Weiler

    I think I found the problem.  I skipped a step during the cod using a jar of J2ME as a source of files.

    In the projectroperties:Application panel, I do not enter the name of my main class name of the Midlet main class field.  Apparently this area causes the main class to be the entry point.

    With the class entered into this field and re - build the cod file and new signing, I was able to download and run the game on a device.

  • Problem files multiple cod

    Hello

    I have an application that is larger than 64K. Sign Tool sees two cod files - app.cod and 1.cod app. However, the app.jad indicates that it is 7 files, app.cod, 1.cod - app, app - 2.cod and so on. After the signing of the cod file, I put them on my Web server. However, when I tried to install it DIRECTLY on my phone, I got a download failure. Anyone know what is happening? Thnx.

    Problem solved. I already had a file vary to great graphics with the project. After that I remove it from this project, the compiler does not refresh the jad. I deleted and let it be regenerated and correct created jde.

  • How to pack and install integrated BBM app?

    I have an application integrated BBM6.0, based on the substitute auditor of dependence, i.e. the app runs with or without BBM 6.0. However, it has 3 files of cod - inteface.cod, impl.cod, app.cod (as the example of TIC-TAC-TOE)

    I don't know how to install all of them on Simulator or device - one by one, using the jad appropriate or to create a jad joint and define each of the cod files inside?

    How it works with the installation of BB App World - is to download three files-cod well enough?

    Any tips are appreciated

    On App World you just download all 3 cod and it will work.

    The Simulator just create a new run configuration and select all the three projects for her to run.

    To test the device I use updatejad.exe to add the common.jad and the dependant.jad to the main.jad.  Then you put all the cod and the main.jad on the server to install OTA.

    I hope this helps.

  • How to send files to cod both to AppWorld?

    Hi all

    I developed an application, this application has features BBM.

    to do this, I conducted BBM dependency Checker. I have two files of cod is original app and the other is proxy.

    I submitted the cod both files (COD app a carrot & another proxy). I submitted using the * file Bundles (Add filebundle). Here I asked the two cod files in a folder and it compressed and renamed the extension to .zip in .cod, and this .cod file I added via "Add filebundle".

    But it does not work in AppWorld, please can you suggest to submit the same for approval.

    Please notify for same, I'll be very complete for the same.

    Thanks in advance.

    Two choices:

    (a) 2 Add to add each cod separately

    (b) simply add the zip (not renamed COD).

    You can add several separate files in your App World submission cod,

  • QR Code pop camera to scan problem

    Hi, I'm scanning the QR code with my code. My code works well with OS 5.0 phones (Bold) and 7.1 (Torch). It works well with 7.1 and 5.0. but give problem when running with 6.0 OS (Bold 9700). The problem is - "so that the attempt at analysis of QR code, app scans the QR code but the device screen is not pop and remains at the front. Event, that is not able to hide using the ESC key." Please help me to solve the problem with os6. Ankit

    Hi all

    I solved my problem for os 6. After the sweep of QR code, close all the connection reader and scanner.

    Used-

    If (_scanner! = null & _scanner.getPlayer ()! = null) {}
    _scanner.getPlayer (). Close();
    }

    It is useful for me.

  • Try to explain the difference between a DPS application and a coded / from scratch app.

    Guys, I need help.  I'm writing a guide for my clients regarding the DPS. I want to include some information on the differences between a DPS App and a code app. Any of you have ever had to explain that, and if you have, what did you say?

    The most obvious difference is that a DPS app is what you get InDesign and a coded app, you must have a coder.  But what are the feature differences? As I am not a coder and do not have access to the resources of coding, I'm at a loss.

    Thank you

    Karen

    They are large enough.

    In short, the DPS is a solution or a framework that allows non-technical people to create content for use on multiple platforms, with various limitations by platform. Especially there sense for Magazines and newspapers as a platform target, with a few exceptions.

    For example, DPS does not access the hardware device API, such as the cameras of the device, the GPS or accelerometer. Limits of the DPS depending on also what license you buy, for example, if they are a client of the company, they would be able to build a showcase custom, which is not available in the Pro licenses or simple editing.

  • questions of privilege properties addToolButton

    Hello

    I am trying to add a button of toolbar with a JavaScript script to the folder level and I have a few questions of privilege.

    I want the button to be an icon. But to open a doc to import the image I need a privileged context. The button must also be like a power button, which remains marked when you press once and becomes unmarked when you press new. Therefore, what I tried... but unfortunately does not work. Even if I set global.isBankStatement false at the beginning as the key is marked. I also tried to set cMarked: false and 'false', but always the button is marked. Only when I omit the property of cMarked, it is not enabled.

    Any hint is appreciated ;-)

    (I work with Windows Vista and Acrobat 9 Pro)

    global.isBankStatement = false;

    icon var = {app.trustedFunction (function ()}
    app.beginPriv ();
    myDoc var = app.newDoc ();
    myDoc.importIcon ("myIcon", "/ C/acrobat_images/bank_20x20.gif", 0);
    var oIcon = util.iconStreamFromIcon (myDoc.getIcon ("myIcon"));
    myDoc.closeDoc (true);
    Return oIcon;
    });

    marked var = {app.trustedFunction (function ()}
    app.beginPriv ();
    var result = global.isBankStatement;
    app.endPriv ();
    return the result;
    });


    app.addToolButton({)
    cName: "myToolButton."
    oIcon: "icon."
    cExec: "handleBankStatements()."
    cTooltext: "bank statement."
    cEnable: «event.rc = (app.doc!» (= null)",
    NPO: 1,
    cMarked: 'event.rc = marked. "
    });

    Don't know if it is the cause of the problem, but since marked is a function you must call it as follows:

    marked()

Maybe you are looking for