Java Script in Acrobat

I am trying to make a popup Menu under a button in Acrobat X. For this I added a Javascript in the Button menu.
I get the impression that there is a limit to the amount of lines Acrobat can manage because I get error messages that are not logical and when I delete a random line everything is ok.
Is there anybody with experience in this matter?

It gives diverse SyntaxErrors. Missing spaces or other things in diffenet lines. There is really no logic in that. And when I reduce the ammount of lines, no matter what line I delete, it functions.
I can give you the script on a point where it doesnot function anymore. The thing I added last was the second submenu. And thank you for reacting!
var cChoice = app.popUpMenuEx
        {cName: "Tg. Winterberg",oSubMenu:
        {cName: "De Jazzbarones",cReturn: "2"}
        {cName: "Maas",oSubMenu:
        {cName: "Cash.",cReturn: "3"}
        {cName: "DOX - I Have a Dream",cReturn: "4"},
        {cName: "BonteHond/Pompei - Dutch Vinex Wonder Boys",cReturn: "5"},
        {cName: "BEER Muziektheater",oSubMenu:
           [{cName: "Dali, of hoe word ik beroemd",cReturn: "6"},
           {cName: "Ik ben niet bang",cReturn: "7"}]
        {cName: "BonteHond/NTjong - Zebra Zebra",cReturn: "8"},
        {cName: "BonteHond - Harig Hondje",cReturn: "9"},
        {cName: "De Toneelmakerij - KoudVuur!",cReturn: "10"},
        {cName: "De Toneelmakerij/Firma Rieks Swarte - De Storm",cReturn: "11"},
        {cName: "Esther de Koning/STIP",oSubMenu:
        {cName: "H.O.T.-het begin",cReturn: "12"}
        {cName: "Het Houten Huis",oSubMenu:
        [{cName: "Hotel Perdu",cReturn: "13"},
        {cName: "Beet!",cReturn: "14"}]
        {cName: "Het Laagland",oSubMenu:
        [{cName: "WIM IS WEG",cReturn: "15"},
        {cName: "ROBIN HOOD",cReturn: "16"},
        {cName: "KOFFERS OP REIS",cReturn: "17"}]
        {cName: "Hetpaarddatvliegt",oSubMenu:
        [{cName: "Later als ik dood ben",cReturn: "18"},
        {cName: "Rooi kop",cReturn: "19"}]
        {cName: "Maas",oSubMenu:
        [{cName: "Alleen op de Wereld",cReturn: "20"},
        {cName: "Wild Thing",cReturn: "21"},
        {cName: "De Nieuwe Jetse",cReturn: "22"},
        {cName: "Helaas Pindakaas",cReturn: "23"}]
        {cName: "Raaijmakers & Geerlings/STIP - Niet Huppelen!",cReturn: "24"},
        {cName: "Theater Gnaffel",oSubMenu:
        [{cName: "Apenstreken",cReturn: "25"},
        {cName: "Peter Pan en de verloren jongens",cReturn: "26"}]
        {cName: "Theater Sonnevanck",oSubMenu:
        [{cName: "Tijl Uilenspiegel",cReturn: "27"},
        {cName: "Engel met vieze voeten",cReturn: "28"}]
        {cName: "Tg. Winterberg/STIP - Op een klein stationnetje",cReturn: "29"}

Similar Messages

  • Java Script Adobe Acrobat 5.0

    O Adobe Acrobat 5.0 suporta java Script?
    O que eu posso fazer com o java Script dentro do Acrobat?
    Daniel
    [email protected]

    Acrobat 5 has been obsolete for more than 10 years! It sounds as if this was an upgrade looking for an even older version.
    Let's forget that and look at the problem with Adobe Reader. What is the problem there?

  • Can java script be executed inside Acrobat reader 7

    Hello All
    I am quire new to Acrobat. Please tell me if I can execute a java script in Acrobat reader.
    I am using itext library to add java script to a pdf and opening the pdf in reader and get the error
    NotAllowedError: Security settings prevent access to this property or method.
    Global.addWatermarkFromText:1:Document-Level:0000000000000000
    First question can I execute this javascript with Reader itself. If yes how should i get rid of this error

    The Acrobat SDK cannot be used to change the information shown for
    each method in the quick bar in the documentation. If that says the
    method does not work in Reader, then it does not work in Reader...
    I do not think there is any similar method for Reader (adding a
    watermark) - very much an Acrobat function. Unless you can pre-create
    the watermark as a form field, so you only have to change the text at
    runtime.
    Aandi Inston

  • Java scripting-linearized PDF

    Hi, 
    I m working with Acrobat X.  I don't know how to prepare java scripts for the below desired functions. Hoever i want to import some java scripts through Acrobat X "Action Wizard" for batch processing. If you can share these scripts, pls. provide .. 
    1) Java script for setting bookmartks as "Inherit Zoom" 
    2) Java script for initial page view "Bookmarks Panel and Page" only when book marks present in the document. 
    3) Java script for enabeling the PDF files for Fast web view as "Yes" 
    With Regards, 
    B..

    Hi Johnson,
    Thanks for update. Well, i have seen some off the self plug ins or softwares available for the batch processing of PDF files for the said functions. However there may be another way (other than Java scripting) for completing the task.
    Any idea......
    Regards,
    Bhaumik

  • Need help with Java Script to perform a calculation in Adobe Acrobat Pro 9 form

    I have a form (test) that I am creating in Adobe Acrobat Pro 9.
    I need help creating custom Java Script so I can get the desired answer.
    1) There are several questions in each group that require a numerical answer between 0-4
    2) There is a total field set up to sum the answers from all above questions
    3) The final "score" takes the answer from Step 2 above and divides by the total possible answer
    Any help on what Java Script I need to complete this would be greatly appreciated!
    I've attached a "spreadsheet" that shows it in more detail as well as what formulas I used in Excel to get the desired end result.
    Thanks in advance.

    Have you tried the "The field is the average of:"?

  • Acrobat 9 - how do you create a dynamic stamp to include the current date (java script)

    I have seen my question multiple places and times but the resolutions provided have not worked for me.
    I am running Acrobat 9 Pro, cannot run X or XI due to the use of ProSystem fx Engagement.
    I want to create what I thought would be a simple stamp. My initials and the current date. i.e. "crm 01/10/13".
    Simple right? I created a PDF of my initials. Now I just need the text field with the proper Java Script to insert the date, correct?
    I have tried opening "Dynamic.pdf" and copying and pasting the text field that includes the Java Script:
    " event.value = (new Date()).toString(); AFDate_FormatEx("h:MM tt, mmm dd, yyyy"); "
    The date does not update, it stays static.
    I have manually entered the Java Script.
    I have edited the Java Script to remove the "Ex".
    I have edited the Java Script to revise the "yyyy" to "yy".
    I have edited the Java Script to remove the " h:MM tt, " trying different formats to get "dd/mm/yy".
    I have selected "Use single-key accelerators to access tools" in Preferences/General.
    I have tried PDF files, PNG files. I have created the image files from Word and Excel.
    I am at my wits' end. Can someone PLEASE assist me to resolve what should be a simple issue (I hope).
    Thank you in advance.

    Thank you for your response.
    Your script works well, but I still have the same issue.  The date is remaining static to the system date when the stamp is created.  My initial idea was to create a pdf of my initials "crm" and then add the text field with the java script for the date behind my initials.  "crm" + (TEXT FIELD with JS).  I wanted 3 stamps, red, blue and green.  The colors correspond to specific processes in our workflow.
    Your script adds my initials as well as the date.
    My machine is running Windows 7.
    My stamps are located:
    C://Documents/Acrobat Stamps/...
    Acrobat templates:
    C://Program Files (x86)/Adobe/Acrobat 9.0/Acrobat/plug_ins/Annotations/Stamps/ENU/...
    I have no problem creating stamps, just a stamp that will use the current system date.  I HATE using the typewriter for my initials and the date.  I guess I can stamp my initials and then type the date...but what is the point?
    Do you have any further thoughts or suggestions?
    Thank you very much.
    crm 01/11/13 

  • Java Scripting in Adobe Acrobat Pro

    Company that I work for wants to create a form using Acrobat Pro with Java Scripting that allows access to data source. Is that possible? It is only being sent out to 350 people. Would we have to purchase LiveCycle still? Would really appreciate any input. Thank you

    Depends on a couple of things.
    Do you have Acrobat X Pro or Acrobat XI Pro?
    If you have Acrobat X Pro then you also have Adobe LC Designer and can use an XFA based form with OLEDB to connect to your data source.
    If you have Acrobat XI Pro then Adobe LC Designer is no longer included and you would be creating an AcroForm.  In that case then "No"  an OLE database source would not be directly available.  But you could use a webservice to achieve similar results with Acrobat JS if you were using a web server.

  • Acrobat standard 9.0 error while enabling commets option using Java script object

    I'm using the below java script code in my VB 6.0 application for enabling commets options in the PDF file
    Dim oJSO As Object
    Set oJSO = mPDDoc.GetJSObject
    oJSO.Collab.showAnnotToolsWhenNoCollab = True
    It is working fine till Acrobat 8.0. Now I'm trying with Acrobat 9.0 standard edition, it is throwing scripting error 'An unhandled Win32 exception occured in Acrobat.exe[308].
    Can anyone suggest the way to enable 'comment' options in Acrobat Standard 9.0 using Java Script Object?
    Thanks

    I get much the same problem with VB6, Acrobat 9 Pro and WinXP SP3. When I single step the line:
    oJSO.Collab.showAnnotToolsWhenNoCollab = True
    in debug I go to the error handler for my Sub. Inspecting the VB Err object has Number = -2147417851 and Description = "Automation error
    The server threw an exception." I get a Microsoft crash notice about Acrobat a short while later.
    I've experimented with the JavaScript debugger in Acrobat and you can execute Collab.showAnnotToolsWhenNoCollab = True and reference the value of Collab.showAnnotToolsWhenNoCollab in the console. The problem appears only when accessing Acrobat Javascript through the Interapplication Communication API.
    If anyone can help it would be appreciated. I tried Adobe's Acrobat support and they were no help at all.

  • Java script created in Adobe Acrobat not working in Reader

    Hello,
    This is my first post, so I hope I chose the correct path for it
    Let's get to the point:
    I created a java script in Adobe Acrobat according to your tutorial page:
    search.matchCase = false;
    search.wordMatching = "BooleanQuery";
    search.bookmarks = false;
    search.query("Mytxt","Folder","../My directory");
    which I found to be working as a let's call it a relative link, beacuse, after copying my file into another folder it would still work. But when I opened the same file in Adobe Reader I got a Console message:
    Acrobat EScript Built-in Functions Version 10.0
    Acrobat SOAP 10.0
    GeneralError: Operation failed.
    Search.query:4:Link undefined:Mouse Up
    Folder does not exist
    As I mentioned before the same file does return the results of the search.query in this folder in Acrobat. Any ideas? Suggestions? What might be the problem?

    Thanks to your suggestion I started digging into the directories, so here's what's funny:
    Title Page - main folder
    Page 1 - sub folder
    Searched PDFs - sub sub folder
    I open the Title Page, then using a bookmark I open a new file in the same window: Page 1. There i have site links that allow me to perform search.query()
    And now to the funny part:
    In Acrobat:
    If I open the "Title Page" and from there go to Page 1 my directory has to be:
    ../Main Folder/Sub Folder/Sub Sub Folder
    to perform the required search
    However If I open the "Page 1" manually my directory for the same java script has to be:
    ../Sub Folder/Sub Sub Folder
    otherwise I get an error.
    Anyway
    Both don't seem to work in Reader....

  • Creating order form and need Java Script to calculate unit price and quantity in Acrobat Pro.

    Hi,
    I am creating order form in Acrobat Pro , and I have
    code
    Order Quantity
    Unit price $
    201
    500
    $ 0.52
    201
    1000
    $ 0.36
    202
    300
    $ 0.26
    202
    500
    $ 0.2
    How make Subtotal and Total price with Java script.
    I do not know how to write java script.
    Anyone can help me?
    Thanks,

    Thanks for your response. I have 2 quantities and 2 Unit price for each code, I know a simple sum in calculation it works for 1 unit price and quantity.  Can you please let me know how to do it? One of the expert sent m this:
    //change field names as needed
    var qt1 = this.getField("qt1").value;
    var up1 = this.getField("up1").value;
    var qt2 = this.getField("qt2").value;
    var up2 = this.getField("up2").value;
    event.value = (qt1 * up1) + (qt2 * up2);
    I put this in total text field (calculation tab , Custom script) , but it  did not worked.
    I appreciate it if anyone can help or give me  suggestion.

  • Using Java Script in Adobe Acrobat

    I am attempting to create input forms using Adobe Acrobat. I've got the form created, and most of the functionality works. The only issue I'm having is that my end users need to be able to fill out the form, click the Submit button, and the form data needs to be sent to an e-mail address for processing. I don't need the form to be saved and sent as a PDF attachment, I just need the form data to be submitted as the BODY of an e-mail. I was told I needed to write a Java Script for this, but I don't know the first thing about that. Can anyone help me out with a Javascript they already use? I've got a week to make these forms work.

    Most web hosting services will have a mailform type script installed and available for use. If you're running your own web server, such scripts are freely available. The form just needs to be configured correctly to work with the server script. When the form is submitted to the web server, the server-side mailform script reads the incoming data and generates an email that includes the name/value pairs in the body of the email. There are literally thousands of such scripts available, to you'd have to refer to their documentation for information on setting up the form to submit to the script you want to use.
    No scripting is necessary in the form in order to submit to the web server, thought the submitForm method can be used and offers a bit more flexibility. For example, you can use a script to check the form for completeness/correctness before submitting and abort if something is wrong.
    A major advantage of submitting to a web server is it is generally far more reliable than the alternative of relying on the user's system to send the email. It can also be secured relatively easily with HTTPS/SSL, though that just covers the form submission and not when the server sends the email.

  • Load an Advanced Print Setting in Acrobat via Java-Script

    Hi there,
    I'd like to know, if there's a way to load an advanced print setting in the Acrobat via Java Script or some other way? (See Screenshot)
    Or is it possible to set an created setting as default-setting? (also via Java or something)
    Or can somebody tell me, where these created print settings are saved? (in Acrobat X)
    Thank you very much for your help and sorry for my english, I hope you understand me. :-)
    Kind regards
    Mankro

    Why wouldn't you want to set itas part of an input/output parameter?
    This is really the right way ofdoing this. Otherwise you'll end up with hardcoded variable name in your customcomponent and that not ideal.
    If you're trying to define a default value for it coming from a properties file, you can just make it a "Configuration" variable and set the value from adminui.
    Jasmin

  • Acrobat Pro 9, why is it ignoring my java script calculations?

    I am using a PC with Windows XP on it. This has happened many times, and I cant figure it out. I have layed out all of my cells and have given one column the java script commmand to subtract two other columns. I saved it, tested it, closed it, opened it and tested it again. Everything worked fine. I have come back into work this morning to find that the java script is still there and there are still 0's in the column, but it will not calculate anything. What's wrong?
    thanks!

    What  extra work! two, three lines of extra code (may just one) to put a time limit in, that can be overridden with entering a bought serial number. Even shareware peopel do it.
    And I remeber when Acrobat only worked on Mac's. You see it was introduced to Mac's first. Microsoft wouldn't allow it until version 3 or 4.  If I still had my 7100/66 I might could prove was I one of the beta Testers. But that machine was traded in on the G4-500 (which I still own).
    Most major software companies will come out with a new application on the Mac first. Because Mac users tend tobe willing to try out something new on the cutting edge. Then when its prefected they come out with a PC version, and forget about the Mac community.
    Look I am 61. And I didn't just fall off the turnip truck yesterday. I've been around since before the days of the moden internet. I  started with Buliten Boards on 300 baud modem on an old fashion POTS line.  Cost me a fortune in Phonebills
    So don't discount my experiences so lightly. I've used appliactions such as ATM Aldus PageMaker (yes you heard right Aldus). I've use Word Perfect for Mac and PC back when it was owned by WordPefect, then Novell) I've use Microsoft works when it came out for the SE/30. Lotus 1-2-3 both on Mac and PC, FaxSTF, and other that are now none existent on the Mac. Chance are I was using Computers about the same as some of you and probabaly earlier than some. I lived it.

  • Can I post here(Acrobat Windows) Java Script questions here?

    Hello
    Can I post here(Acrobat Windows) Java Script questions here? If not, wht is the correct forum?
    THank you

    Back up and down to Acrobat Scripting. Bot Windows and MacIntosh Acrobat versions use the same JavaScript.
    If you are using LIVECYCLE DESIGNER use their forums. The JavaScript syntax and objects are different in LIVECYCLE DESIGNER!

  • Can I balloon engineering prints in Adobe Reader or Acrobat? Create a dynamic stamp w/ Java Script?

    I am trying to establish a very simple way to balloon prints with character numbers; below I have uploaded an example screen shot.  My end goal is for the user to select a dynamic stamp (a circle with a number in the center) and it start numbering with 1 and then increment by 1 yet the user is placing each balloon in its respective location, resetting for each PDF document, one addition would be to allow the balloon numbers to be edited like a text box after they have been created in case there is an error in balloon placement etc.  Is this possible? I have programming experience in other languages, but have only built a few dynamic stamps with time stamp information provided by java script code.
    Any assistance is greatly appreciated!

    Yes it's possible with dynamic stamps, but the code is rather messy as it has to keep a running total.
    See http://www.pdfscripting.com/public/department53.cfm for some samples (and the definitive book on creating your own dynamic stamps), and Rick Borstein's blog for some basic samples that put exhibit numbers on legal documents.

Maybe you are looking for