Using Javascript in Acrobat to emulate LiveCycle Image Field

Hello All,
I have a complex pdf form with numerous validation & calculation javascript calls that really could use the image field functionality of LiveCycle: that is, to have a user with Reader insert their own image into a fillable form.  The images do not need to be submitted or extracted in any way.
Is there any work around for this feature in Acrobat 9 Pro (which I have) or X (which I might be able to get) with JS that might create or approximate the image field functionality?  Given the complexity and volume of JS calls, I can't see it being worth converting the form to LC and recreating is not an option at this point.  Any advice would be welcome.  Thank you in advance.

Unfortunately no, which is a pointless and silly restriction. Please submit a feature request for this in the hope that it may get restored some day. Feel free to add to this one: http://forums.adobe.com/thread/743823?tstart=0
This issue came up yesterday both here: http://forums.adobe.com/thread/844010?tstart=0
and here: http://forums.adobe.com/thread/844480?tstart=0
Though I'm not at all convinced that Leonard R. is right. Even if he is, it would make it out of reach of most.

Similar Messages

  • Using Javascript With Acrobat Forms

    Hello,
    I have been attempting to use Javascript with forms made using Acrobat X Pro. Particularly, I am attempting to use the Font palette with Text fields as described in http://partners.adobe.com/public/developer/en/tips/CalcScripts.pdf .
    One example of this is the Strikethrough property.  TextField1.caption.font.lineThrough = "linethrough" and TextField1.font.lineThrough = "linethrough". I see that "linethrough" is an enumeration (Having values of 0,1, and 2). But I have tried this numerous times, in various ways, and it does not work. I also tried other Font properties and could not get them to work. Is there more setup to this? I am still very much new to developing Forms, and it was frustrating for me to not find a resource that outlined all of the stuff you could do with Forms. My only prior experience with Javascript is for web pages. The pdf I mentioned above seemed promising, but I'm having trouble implementing it.
    I appreciate any help for this!

    For questions about LiveCycle Designer use the forum LiveCycle Designer.

  • How to hide/disable menu items using Javascript in Acrobat 9 pro or later

    We just wanted to know on how to hide/disable menu items for e.g. 'Open' menu item under 'File' menu in Acrobat 9 or later on Mac using Javascript. It would be useful if you could provide if any other option is in place already.

    Not sure it will work, but you can try using the app.hideMenuItem() method. See reference here.

  • Using JavaScript with Acrobat XI Standard

    I am part of a transition team setting up a new correctional facility. I am working with our IT dept to purchase licenses for Acrobat XI. I need to get a definitive answer on using JavaScript with XI standard. The forms I am working with have a variety of scripts mostly button activated. Actions include saving and renaming files to a networked drive. Money is always an issue so if I can use XI standard that would be the better financial choice. The documents will not be created using XI standard just processed.

    This is the Reader forum; the Acrobat one is here:
    http://forums.adobe.com/community/acrobat

  • Get location/coordinates for a field using JavaScript in Acrobat Professional

    Good day,
    I am looking for a way to get the coordinates of a text field.
    I would like to create a listbox and set the location of the listbox top left to the text fields bottom left coordinates, I have had a look at the scripting guides ... could not turn up anything.
    I know how to create and populate this listbox using the JavaScript code, only problem is, to get the coordinates of the text box.

    Try this:
    1. Move or change the dimensions of the text boxes on the extracted page in the configuration that you want.
    2. When you are satisfied with the new configuration, modify the following JavaScript to use the names of the text boxes that you want to include on the page.
    //find_rect //find coordinates of text boxes whose names are included in the var rct,ary = ["fld_1","fld_2","fld_3","fld_4"]; //...etc.
    for (j = 0; j<ary.length; j++){
    console.println(ary[j]);
    rct = this.getField(ary[j]).rect;
    for (i= 0; i< rct.length; i++) console.println(rct[i]);
    3. Add the modified code to the document level of form. (as a doc level javascript but with no function name or brackets included.
    4. When you run the code, the coordinates for the fields that you have included in the array will be printed in the console window:
    Example:
    fld_1
    21
    777
    296
    717
    fld_2
    30
    769
    65
    729

  • Select only one type of field using JavaScript in Acrobat X

    Looking for a way to select all fields of the same type on a form at once?
    Such as selecting all text fields to modify the font type, or all buttons to modify display values. Prior versions 6,7, & 8 were able to do this. Would prefer a script for each control type however I do not see any information in the JavaScript Reference Guide about this.

    The is no UI for selecting field by type in the newer versions of Acrobat.
    Have you looked at the numFields property and example?
    With some modification:
    function FindFieldType(cType)
    var aFieldNames = new Array(); // array of fields of type sFieldType
    // walk the array of field names;
    for ( var i = 0; i < this.numFields; i++) {
      var fname = this.getNthFieldName(i); 
      if ( fname.type = cType ) {
      // match to field type - add to array of names;
      aFieldNames[aFieldNames.length] = fname;
      } // end walk array of field names
    return aFieldNames;
    } // end FindFieldType function
    var aMyFields = new Array();
    // find button field type
    aMyFields = FindFieldType("button");
    // now do something with the array of field names;
    app.alert("button fields: \n" +  aMyFields.join("\n");

  • Handling 3d objects using JavaScript for Acrobat 3D Annotations API

    I am trying to learn how to handle 3d objects with this manual: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_3d_api_reference.pdf
    When I execute some code, for example,
    myTimeHandler= new TimeEventHandler();
    myTimeHandler.onEvent= function( event )
    console.print( "Current simulation time is:" + event.time );
    console.print( " second(s)" );
    runtime.addEventHandler( myTimeHandler );
    I get an error like this:
    TimeEventHandler is not defined
    Why?
    P.S. I have 3d object in the document, and can get it with function getAnnots3D.

    You have to run the code in the context of the 3D annotation (by attaching the script to the annotation's properties panel, or by right-clicking the active 3D scene and choosing "run a javascript". You cannot run it in the console.

  • Using Javascript in Acrobat to set flashvars

    Hi,
    I have SWF embedded in a PDF to which I want to pass flashvars. Unfortunately, I do not have the values for these flashvars during embedding the SWF (the javascript in the PDF determines the values tobe passed to the flashvars when the document is opened). Is it possible to set flashvars dynamically from the javascript in the PDF ?
    The RMA (Rich media annotation) object seems to have no property/method that I can use for my purpose.
    Thanks in advance!

    Hi,
    Thanks for replying. But this example sets falshvars through the UI, and as I have mentioned I want this done from javascript in the document - I dont have the value for some of the flashvars during embedding.
    (Using a EI call is my last resort, as I am not expected to make any modification to the SWF file - the SWF file, hitherto, was being hosted in a HTML where it was being passed flashvar params)

  • Using Javascript to create concatenated string from checkbox fields to one text field

    Hi. I have a PDF form that I am trying to have output to a spreadsheet that matches my database schema. Here is the dilemna:
    * I have a set of checkboxes for available languages (LANGUAGE_ENGLISH, LANGUAGE_SPANISH, etc.) When they export to spreadsheet, the value is TRUE.
    * I need to take values from checked boxes and create a single string in a text field called LANGUAGE_DISPLAY (so my UI will not need to do the concatenation). If LANGUAGE_ENGLISH is TRUE (checked), append "English, " to LANGUAGE_DISPLAY, else append "". Then, if LANGUAGE_SPANISH is TRUE (checked), append "Spanish, " to LANGUAGE_DISPLAY, else append "". And on and on
    In the LANGUAGE_DISPLAY text field properties, I am inserting a Custom Calculation script to try to achieve this, but am not getting any results. I tried teh following even trying to pull the checkboxes default values and string them together:
    box1 = this.getField("LANGUAGE_ENGLISH").value.toSrting();
    box2 = this.getField("LANGUAGE_FARSI").value.toSrting();
    box3 = this.getField("LANGUAGE_MANDARIN").value.toSrting();
    event.value = box1 + ', ' + box2 + ', ' + box3;
    I also played with this to get the desired strings output...but to no avail:
    if ( LANGUAGE_ENGLISH.rawValue == true )
    box1.rawValue = "English, ";
    if ( LANGUAGE_FARSI.rawValue == true )
    box1.rawValue = "Farsi, ";
    if ( LANGUAGE_HEBREW.rawValue == true )
    box1.rawValue = "Hebrew, ";
    event.value = box1 + box2 + box3;
    Then I tried to simplify to see one field output so used this script...still no results:
    event.value = "";
    var f = this.getField("LANGUAGE_ENGLISH");
    if ( f.isBoxChecked() == true) {
    event.value = "English";
    Couple questions:
    1) Am I on the right track with any of these scripts?
    2) Is there something else I need to do to get the script to run before running the Create Spreadsheet with Data Files comman in Acrobat to get my csv file output? Maybe there needs to be some event to get the checkbox values read by that field in order to calculate/create the string.
    Appreciate any help you can provide.

    LiveCycle Designer has shipped with all Acrobat Professional versions since the "Professional" version was introduced with version 6.
    You do not let us know want results you get in the field or the JavaScript console.
    Using:
    box1 = this.getField("LANGUAGE_ENGLISH").value.toString();
    box2 = this.getField("LANGUAGE_FARSI").value.toString();
    box3 = this.getField("LANGUAGE_MANDARIN").value.toString();
    event.value = box1 + ', ' + box2 + ', ' + box3;
    returns "Off, Off, Off", when no box is checked and returns "Yes" for the appropriate box being checked when the default value is used for the creation of the check box. So if one would make the 'Export Value' of the box from the default value of 'Yes" to the appropriate language, one would get a more desirable result. But for each unchecked box the value would appear as "Off". So one needs to change the 'Off' value to a null string. But one is still left with the separator when there is an unchecked option.
    Using the following document level function:
    // Concatenate 3 strings with separators where needed
    function fillin(s1, s2, s3, sep) {
    Purpose: concatenate up to 3 strings with an optional separator
    inputs:
    s1: required input string text or empty string
    s2: required input string text or empty string
    s3: required input string text or empty string
    sep: optional separator sting
    returns:
    sResult concatenated string
    // variable to determine how to concatenate the strings
    var test = 0; // all strings null
    var sResult; // re slut string to return
    // force any number string to a character string for input variables
    s1 = s1.toString();
    s2 = s2.toString();
    s3 = s3.toString();
    if(sep.toString() == undefined) sep = ''; // if sep is undefined force to null
    assign a binary value for each string present
    so the computed value of the strings will indicate which strings are present
    when converted to a binary value
    if (s1 != "") test += 1; // string 1 present add binary value: 001
    if (s2 != "") test += 2; // string 2 present add binary value: 010
    if (s3 != "") test += 4; // string 3 present add binary value: 100
    /* return appropriate string combination based on
    calculated test value as a binary value
    switch (test.toString(2)) {
    case "0": // no non-empty strings passed - binary 0
    sResult = "";
    break;
    case "1": // only string 1 present - binary 1
    sResult = s1;
    break;
    case "10": // only string 2 present - binary 10
    sResult = s2;
    break;
    case "11": // string 1 and 2 present - binary 10 + 1
    sResult = s1 + sep + s2;
    break;
    case "100": // only string 3 present - binary 100
    sResult = s3;
    break;
    case "101": // string 1 and 3 - binary 100 + 001
    sResult = s1 + sep + s3;
    break;
    case "110": // string 2 and 3 - binary 100 + 010
    sResult = s2 + sep + s3;
    break;
    case "111": // all 3 strings - binary 100 + 010 + 001
    sResult = s1 + sep + s2 + sep + s3;
    break;
    default: // any missed combinations
    sResult = "";
    break;
    return sResult;
    And the following cleaned up custom calculation script:
    box1 = this.getField("LANGUAGE_ENGLISH").value;
    box2 = this.getField("LANGUAGE_FARSI").value;
    box3 = this.getField("LANGUAGE_MANDARIN").value;
    if (box1 == 'Off') box1 = '';
    if (box2 == 'Off') box2 = '';
    if (box3 == 'Off') box3 = '';
    event.value = fillin(box1, box2, box3, ', ');
    One will get the list of languages with the optional separator for 2 or more language selections.

  • Adding current date to text field w/ Javascript in Acrobat 8

    I am trying to add the current date to a text field using javascript in Acrobat 8 Professional. I am using the util.printd function in a javascript function but the date of creation shows in the text field, NOT today's date. Any clues??
    var f = this.getField("myField");
    if (!f.value) f.value = util.printd ("m/d/yyyy", new Date());

    Thanks. I've used it also without the empty value check and had the same result of showing the creation date and not the current date.

  • How to manipulate pdf files using javascript in action wizard

    Respected all ,
    I am a software programmer from india and i want to make a programe which can do below described things :
    I want to know that how can i achive this kind of steps using javascript in acrobat XI :
    for ex. if i have  4 pdf files :  800123-001.pdf , 800123-002.pdf    and  800555-001.pdf , 800555-002.pdf
    then i want to do using javascript
    step 1 :  pdf to ps , output should be : 800123-001.ps , 800123-002.ps , 800555-001.ps , 800555-002.ps
    step 2 : ps to pdf (acrobat distiller ) : 800123-001.pdf  , 800123-002.pdf , 800555-001.pdf , 800555-002.pdf
    step 3 : pdf merge : 800123.pdf  - > which contains both : 800123-001.pdf and 800123-002.pdf
                   and                     800555.pdf -> which contains both : 800555-001.pdf and 800555-002.pdf
    ----------END------------
    Is it possible using javascript in acrobat or any other way ?

    i can not access adobe site .. can you plz replay me on my personal e
    mail.. [removed personal contact info, please send a forum message instead]
    On Wed, Jun 19, 2013 at 1:16 AM, Test Screen Name
    Message was edited by: sinious

  • Using Javascript to calculate monthly payments on form

    I have a single page form where I would like to be able to
    allow the user to choose between making a one time payment or
    monthly payments for a user defined amount. I could easily break
    the form into two pages and calculate the value of the monthly
    payments and display it on the second page if the user selected the
    monthly payment option. What I would like is a single page where
    the monthly payment is determined on the fly when either the user
    selects the monthly payment radio button or when the user defined
    dollar amount is entered.
    I think I have the function determined to do the calculation
    for the monthly payment but I'm unsure as to how to get cf to read
    or display the value. I was trying to use the following with no
    luck:
    <input type=radio name=Installments value="Yes" tabindex=1
    onClick="calculatemonthlypayment(document.forms[0].DonationAmount)">
    <script type="text/javascript">
    function calculatemonthlypayment(donation)
    monthlypayment=(donation/12)
    return monthlypayment
    </script>
    Then trying to output the result like this:
    <cfoutput><input type="text" readonly="yes"
    value="#dollarformat(monthlypayment)#"></cfoutput>
    Any idea what I'm doing wrong or missing? Or is there a much
    better way to accomplish this?

    > <cfoutput><input type="text" readonly="yes"
    value="#dollarformat(monthlypayment)#"></cfoutput>
    You cannot do that. CF code is executed on the server
    (first). The resulting javascript (html, css, ...) code is then
    sent to the browser where it is executed. Since javascript code is
    executed in the client browser,
    after the CF code is already finished, the variable
    "monthlypayment" doesn't exist as far as CF is concerned.
    You can use javascript to both read the donation text field
    amount and calculate the "monthlypayment" amount to display. Here
    is a simple example. You'll need to add validation and number
    formatting.

  • Set "peoples or groups" field with current user "login name" in sharepoint list form using javascript

    hi friends
    i am trying to set peoples or groups field in sharepoint  list form with current user login name
    here my code
    <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"></script>
    <script type="text/javascript">
    $(document).ready(function NewItemView () {
    var currentUser;
        if (SP.ClientContext != null) {
          SP.SOD.executeOrDelayUntilScriptLoaded(getCurrentUser, 'SP.js');
        else {
          SP.SOD.executeFunc('sp.js', null, getCurrentUser);
        function getCurrentUser() {
          var context = new SP.ClientContext.get_current();
          var web = context.get_web();
          currentUser = web.get_currentUser();
          context.load(currentUser);
          context.executeQueryAsync(onSuccessMethod, onRequestFail);
        function onSuccessMethod(sender, args) {
          var account = currentUser.get_loginName();
          var accountEmail = currentUser.get_email();
          var currentUserAccount = account.substring(account.indexOf("|") + 1);
        SetAndResolvePeoplePicker("requester",account);
    // This function runs if the executeQueryAsync call fails.
        function onRequestFail(sender, args) {
          alert('request failed' + args.get_message() + '\n' + args.get_stackTrace());
     function SetAndResolvePeoplePicker(fieldName, userAccountName) {
       var controlName = fieldName;
        var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + controlName + "']");
        var peoplePickerEditor = peoplePickerDiv.find("[title='" + controlName + "']");
        var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
        peoplePickerEditor.val(userAccountName);
        spPeoplePicker.AddUnresolvedUserFromEditor(true);
    </script>
    but it is not working
    please help me

    Hi,
    According to your post, my understanding is that you wanted to set "peoples or groups" field with current user "login name" in SharePoint list form using JavaScript.
    To set "peoples or groups" field with current user "login name”,  you can use the below code:
    <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"></script>
    <script type="text/javascript">
    function SetPickerValue(pickerid, key, dispval) {
    var xml = '<Entities Append="False" Error="" Separator=";" MaxHeight="3">';
    xml = xml + PreparePickerEntityXml(key, dispval);
    xml = xml + '</Entities>';
    EntityEditorCallback(xml, pickerid, true);
    function PreparePickerEntityXml(key, dispval) {
    return '<Entity Key="' + key + '" DisplayText="' + dispval + '" IsResolved="True" Description="' + key + '"><MultipleMatches /></Entity>';
    function GetCurrentUserAndInsertIntoUserField() {
    var context = new SP.ClientContext.get_current();
    var web = context.get_web();
    this._currentUser = web.get_currentUser();
    context.load(this._currentUser);
    context.executeQueryAsync(Function.createDelegate(this, this.onSuccess),
    Function.createDelegate(this, this.onFailure));
    function onSuccess(sender, args) {
    SetPickerValue('ctl00_m_g_99f3303a_dffa_4436_8bfa_3511d9ffddc0_ctl00_ctl05_ctl01_ctl00_ctl00_ctl04_ctl00_ctl00_UserField', this._currentUser.get_loginName(),
    this._currentUser.get_title());
    function onFaiure(sender, args) {
    alert(args.get_message() + ' ' + args.get_stackTrace());
    ExecuteOrDelayUntilScriptLoaded(GetCurrentUserAndInsertIntoUserField, "sp.js");
    </script>
    More information:
    http://alexeybbb.blogspot.com/2012/10/sharepoint-set-peoplepicker-via-js.html
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How do I set (or auto populate) the value of a modal dialog field using javascript?

    I have a Modal Dialog on my SharePoint 2010 page the following fields: Your Name, Subject, Priority, Message. 
    It links to a list I have on the site. The second field, Subject, I want to auto populate it when the window opens, so the user can leave it as is or modify the subject. I want to set the field value using javascript. 
    I've tried setting the field with this code:
    document.getElementById('Subject').value = "Test";
    and also, this:
    setFieldValue('Subject','My custom value');
    Neither work. 
    How do I set the value of the subject field when the user first opens the dialog using javascript?
    Please help.

    I am sure, you are looking at default field value of a list column(single line) in a modal window, if so please try below code
    <script src="https://code.jquery.com/jquery-2.1.0.min.js" type="text/javascript" abp="397"></script><script type="text/javascript" abp="398">
    $(document).ready(function(){
    $('input[name*="Subject"]').val("Test");
    </script>​​​​​​
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Acrobat 9 Pro - Change Image Compression/Quality w/ Javascript?

    Hello,
    I've got a folder-level script that will merge PDFs by using "insertPages" to add a list of PDFs to a new document. The file size is too large, and I've noticed that if I go into the PDF Optimizer manually and change the Image Settings so the compression quality is "low" for both Color images adn Grayscale images, it brings the file size down to where I need it to be.
    My question is, can I do this in my script somehow? I don't see anything in the Javascript Reference or Acrobat SDK about updating images within document. I'd really like to automate this optimization within my script.
    Has anyone ever done this before?
    Many thanks in advance!    

    Thanks again for your reply!
    Well the output folder could change... and really, it would be most ideal to not even save the single PDFs (although it looks like I might have to). All I need to accomplish is to take a folder of PDFs and merge them into one PDF (but it must be optimized and cropped). I don't need the new, saved versions of the single PDFs. I feel like my "automation" solution to this will end up being more tedious than manually clicking "combine" and merging PDFs that way, and applying the crop settings afterward. Maybe I am making this more difficult than it needs to be? Here is what I'm doing:
    1. I have a folder level script that executes when Acrobat loads whichs adds two menu items. The first opens up the Batch Sequences menu so the user doesn't have to find them.
    2. From here, the user will need to run a batch sequence that will optimize and crop each PDF and save them to an output folder.
    3. Now the user will need to run another batch sequence (and choose the output folder from step 2 as the input folder now) that will collect all the file paths of the optimized PDFs.
    4. Now the user can use my other menu item from step 1 that will execute a folder level script and merge the PDFs by inserting them into a new document.
    5. I can prompt the user here to save the new document somewhere.
    It seems like there should be an easier way to do this. Is it not possible to merge the PDFs in a batch sequence and then use the output folder to save the one new PDF (rather than each of the input PDFs)?

Maybe you are looking for