Improving performance of scripts in a PDF form

Hello there.  I'm a bit new to the scripting in Acrobat and find myself with a complex form that has a number of instances (about 70)  of the following script (specific to individual fields):
event.value=this.getField("Ranks").value + this.getField("Mod").value + this.getField("MiscMod").value;
var trained = "Untrained";
var skill = "Ranks";
if ( (this.getField(trained).value != "On" ) && (this.getField(skill).value < 1)) {
event.target.textColor = ["G", 1]; }
else {event.target.textColor = ["G", 0];}
The code works fine, but with this many instances, performance of form is sluggish while updating. In addition, there are approximately 200 simple addtion fields being used.
I'm looking for any advice, scripting or otherwise, to help improve performance.
Thanks so much in advance.

If you create a function in the document scripts :
function updateField() {
event.value=this.getField("Ranks").value + this.getField("Mod").value + this.getField("MiscMod").value;
var trained = "Untrained";
var skill = "Ranks";
if ( (this.getField(trained).value != "On" ) && (this.getField(skill).value < 1)) {
event.target.textColor = ["G", 1]; }
else {event.target.textColor = ["G", 0];}
you could replace the code in each field with the following function call, and they would all use the same code:
updateField()
Without knowing exactly what 'slightly different code'' entails, you can add parameters to the function call:
function updateField(Rank, Mod, MiscMod) {
event.value= Rank + Mod + MiscMod;
var trained = "Untrained";
var skill = "Ranks";
if ( (this.getField(trained).value != "On" ) && (this.getField(skill).value < 1)) {
event.target.textColor = ["G", 1]; }
else {event.target.textColor = ["G", 0];}
and you could call it in each field with different values for 'Rank', 'Mod', and 'MiscMod' (or whatever parameters you use) like this:
updateField(getField("Ranks").value, this.getField("Mod").value, this.getField("MiscMod").value )
or
updateField(getField("aDifferentRanks").value, this.getField("aDifferentMod").value, this.getField("aDifferentMiscMod").value )
or
updateField(47, 12, 45)
If you need to make changes, you only need to change the 'updateField' function once, and any field which calls it will use the updated code.

Similar Messages

  • Multi-Layer Document Script Triggers in PDF Form

    I have a PDF form that has a total of 5 pages with text fields and navigation buttons. I would like the form to hide/unhide pages based on user input. For instance, the user will start on page 1. Once the user completes all the fields on page 1 the user will click on a button I laid out at the button of the page called "Next" and at this point a validation script should be triggered when the users clicks on the button to make sure all fields are completed before showing the information to be completed in Page 2. Basically I'd like my form to guide the user to the next page as long as the previous required fields are completed before the next page is shown (unhidden). If the fields from the previous page are not completed then the next page(s) will remain hidden.
    How can I go about designing my form to do just that? Any and all your advise, input and help is greatly apreciated!

    You can use templates for this:
    http://livedocs.adobe.com/acrobat_sdk/9/Acrobat9_HTMLHelp/wwhelp/wwhimpl/common/html/wwhel p.htm?context=Acrobat9_HTMLHelp&file=JS_Dev_Templates.80.1.html

  • PHP script for a pdf form

    Hi,
    Can anyone point me in the right direction with this problem?
    I am using Dreamweaver CS3. Is there a php script I can use
    to have the data that a user inputs into a form extracted and put
    on a PDF form that pops up when the user clicks a button so the
    user can then print and fax the completed form?
    I would really appreciate any help.
    Thanks,

    Why go to a PDF? Why not just print from a webpage?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Captain825" <[email protected]> wrote in
    message
    news:g707ol$3b8$[email protected]..
    > Hi,
    >
    > Can anyone point me in the right direction with this
    problem?
    >
    > I am using Dreamweaver CS3. Is there a php script I can
    use to have the
    > data
    > that a user inputs into a form extracted and put on a
    PDF form that pops
    > up
    > when the user clicks a button so the user can then print
    and fax the
    > completed
    > form?
    >
    > I would really appreciate any help.
    >
    > Thanks,
    >

  • Reg: Script Output in PDF form

    Hai..
    Can anybody tell me how we will get script output
    (P.order output) in PDF format and we need to downlaod this PDF to our local drives. plz tell me the function modules to be used for this requirement and paste the code if any of you worked on this earlier..
    Regards

    Check this link for sample program.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49e15474-0e01-0010-9cba-e62df8244556
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/downloadSAPScriptoutputtoPDF+file.&
    Function Module: CONVERT_OTF
    Regards,
    Maha

  • JavaScript issue in PDF Form

    I am wanting to create a script in a PDF form format with Adobe 8.0 (or 5.0 if necessary, what I want it to do is when I fill out a form box "name" on page 3 I have the same thing "name" is there a way for it to bring the information from the first box to the second without me retyping it? I will be using this form A LOT. I am working for a hospice center and have to fill out a ton of paperwork and some of it is very repetitive. Any help would be great, I know a little javascript and I think it can be done with it, any ideas?
    Nora

    If you are using Acrobat and the Form Tool, just use the same name for the field name.
    If you are using LiveCycle Designer, use the same name for the field name select "global" for the field's binding.

  • Send PDF form to e-mail as attachment with a PHP script on the server

    Hi,
    For several days I've been searching though the internet looking for a solution, a quite simple one in my opinion, but I got a little desperate not getting any result I want.
    Okay. The Situation.
    I have a PDF form to order sandwiches and drinks.
    The PDF has serveral area's and columns where customers fill in the amount of the products they would like to order.
    At a position of a field, the kitchen can almost blindly see what products a customer ordered.
    Therefore, when someone fills in the form, I want to send the filled PDF by e-mail to the kitchen's e-mail adress. And important: the PDF in the kitchen's mailbox should be completely identical to the form the customer filled in.
    So, I have an Order button in my form. I set the action as 'Submit a form'.
    In the settings under 'Enter a URL for this link' I used just some PHP mailer script I also use on my website contact form.
    IF I check 'HTML' under 'Export Format' the PHP mailer works fine. I receive an HTML e-mail listed the ordered products.
    BUT
    I do want the original filled PDF in my mailbox instead of an HTML e-mail.
    So, for 'Export Format' I checked 'PDF The Complete Document'.
    But then my PHP mailer script doesn't work anymore.
    It gives errors like 'no valid e-mail adres' , etcetera etcetera.
    Who has a solution?
    Who has a working standard PHP script for me what just sends the kitchen an empty mail with the original PDF as attachment?!
    There is no need to use any database or other more complex functionality. Just mail the filled PDF.

    You can submit whole PDF format as long as you enable usage rights on the PDF.
    Normally Adobe Reader users can only submit the data, XFDF, FDF, XDP, XML.
    To enable usage rights on the PDF you will need to use Adobe Acrobat Std/Pro.
    As for the PHP Script; it depends on your PHP web server capabilities.
    The script will be slightly different, if the server uses PHP Mail or PHP PEAR.
    Just attach the submission to an email and send.
    If the client is submitting the form from a standalone pdf reader app, you can also respond with a success or failure FDF \status message; otherwise, you can redirect to a success / failure URL.
    For more information and online examples:
    http://www.pdfemail.net/examples/

  • Editing a pdf form that I created. Adding header error msg "do not have sufficient permissions to perform this task"

    Editing a pdf form that I created. Adding header, currently the header only appears on page 1 of a 3 page pdf form.  I want it to appear on each page.  I am receiving the error msg "do not have sufficient permissions to perform this task"

    In Adobe Acrobat use a Action for this.

  • Java Script Warning when creating PDF form in LiveCycle ES (8.2)

    When generating a PDF form in LiveCycle ES version (8.2) I keep getting a java script error (yellow bar warning) in Adobe Acrobat Reader 9.3.  This PDF doesn't need java-script ... however I can not find where you turn this off in LiveCycle ES.  Any help would be appreciated.

    Tools > Options > Wizards and Tips. You can show or disable in-place warnings.
    Steve

  • Perform as pdf form with the ability to insert pictures

    How to perform as pdf form. with the ability to insert pictures?

    You want your users to be able to insert images into a PDF form? That is only possible if they're either using Acrobat, or if they're using the latest version of Reader (XI) and the image is in PDF format.

  • How can I perform the conversion of pdf files in Cyrillic script to Word files in Cyrillic script. The pdf file is too small for me to read right now. Julyan Watts

    How can I perform the conversion of .pdf files in Cyrillic script to Word files in Cyrillic script. The .pdf file is too small for me to read without a magnifying glass, and the document is more than one thousand pages.

    This answer was not helpful. First of all, I could not find "tech specs"
    anywhere on the Acrobat 11 homepage. And secondly I purchased this software
    for the specific purpose of converting .pdf files to Word. It was only
    after I had completed the purchase that I learnt that Acrobat does not
    permit the conversion of .pdf files in Cyrillic to Word files  in Cyrillic.
    I feel that Acrobat should have provided this crucial information before I
    allowed my credit card to be debited. That is why I  am now asking for my
    money back. But thanks for your attempt to solve my problem, even if it was
    not successful.
    Julyan Watts

  • Save PDF form into non editable PDF through button (SaveAs) using java script

    I am creating PDF form using LiveCycle 8.0.
    1) Using SaveAs the form in PDF (non editable) by using button and javascript
      ( app.execMenuItem("SaveAs");
         myScript.LoclAllFields("form1");) this code is not working.
    2) show / hide the field by choosing the drop down List.
    Like, In drop down list their is tree option name  a, b, c. when select "A" hide the field_A and select "B". then show the field_A.

    Thanks for that script, it is a great way of securing it from being edited, but reader still won't allow the form to be saved, only as a copy without the inputted text. The idea of what I'm trying to achieve is a form which the staff here fill out and then send to our customers with non editable fields, there is the option to print to pdf but that saves the file as an 'image', this stops people from highlighting text which we don't want, they have to be accessible afterwards to copy and paste the text at a later date.
    I hope someone can help with what should be such a simple action.

  • Are there near future plans to improve pdf form calculation support on ipad?

    I'm trying to produce a pdf form including calculations with variables. It works fine on pc but the calculations are not supported on ipad...
    Does anyone have any info on possible improvements that may be brought by Adobe (and/or Apple) in the near future to bring the "dream" of compatibility a little closer?

    As a policy, we do not publicly announce product plans.
    If you'd like, you can submit the Feature Request form.  The Product Management team will take your request into consideration for a future release of Adobe Reader for iOS.
    Thank you for the feedback.

  • Jave script in PDF Forms

    I'm know axactly nothing about JAVA.   So I apologize in advance if i don't make much sense.
    I am trying to create a PDF form where you enter one value in a field and that changes other
    values in multiple fields.
    I'm not really sure how to explain what i want to do..
    I have a form that has multiple "question fields that change depending on  a single protocol field above the questions.  for example
    protocol 6
    has questions
    1
    2
    3
    3a
    4
    5
    5a
    5i
    6
    6a
    where protocol 26
    has questions
    1
    2
    3
    4
    If needed I could post a picture of the form on here for people to look at.

    I have a form that has 8 question boxes.  The only thing that i have to change is the
    question name depending on the protocol selected.
    some protocols have only 4 questions labeled
    1-4
    but others like my original post will have
    1
    1a
    2
    3
    4
    5
    I would like to figure out a way to automate that.

  • Automate Save as, Reader Extended for 160 .pdf forms using a script or macro?

    I have 167 pdf forms made using Adobe Acrobat Pro X. when I sent out a test it could not be saved using Adobe reader. I know how to Save As; Reader Exended pdf; Enable additional features.  this also forces me to create yet another document called something different like mydoc-2.pdf. Since you can't save these feature in the existing one?
    Is there a way to automate this using javascript or something so I don't have to do each one.
    1. open each pdf documewnt
    2. set the Save As; Reader Exended pdf; Enable additional features.
    3. save as name -2
    repeat 1-3 for 167 files in folder A

    There is no Adobe supported means for automating the application of usage rights, apart from their LiveCycle Reader Extensions server-based product. This is a very intentional restriction.

  • Script for calculations using checkboxes in PDF form

    I have 7 checkboxes, at least one must be checked, but the user may select all. Each one has a value of 800, therefore selecting all seven would give a total of (800 + 800 + 800 + 800 + 800 + 800 + 800). Selecting only two: (800 + 800), etc.
    However, the last checkbox is a 50% discount for students.
    I'd like the total to have this formula:
    (CheckBox1 + CheckBox2 + CheckBox3 + CheckBox4 + CheckBox5 + CheckBox6 + CheckBox7) = x
    If CheckBox8 is selected, then x/2.
    I've done (CheckBox1 + CheckBox2 + CheckBox3 + CheckBox4 + CheckBox5 + CheckBox6 + CheckBox7) / CheckBox8
    but in this way, I only get a value if the CheckBox8 discount is selected. Not everyone will be a student.
    Excel, Access, no problem, but I'm new to javascript and pdf forms. Any suggestions?
    Isabel

    Two things about Acrobat JavaScirpt and forms you should be aware of:
    1. Check boxes and radio boxes have a string value of "Off" when there is no selection is made for the field or a field within an exclusionary group of fields, fields with the same name but different export values.
    2. One can not divide by zero and expect a reasonable answer. You will get a string returned with a value of "NaN' (Not a Number), "Infinity", or "-Infinity". Those values maybe number types but the numeric field type can not display them and reports a format error. You can check this by setting the field format to 'None'.

Maybe you are looking for

  • Using cable modem with blu-ray player

    I just had FiOS installed.  I have a Samsung blu-ray player that's too far away such that wi-fi is not reliable. Can I use a cable modem to gain access hard-wired?  Since the STB has an IP address I take it I should be able to split the coax, feed it

  • Apple TV Photo stream shows photos OLDEST FIRST.. help!

    I love the apple tv, but the photostream is driving me nuts.  It's pretty useless.  I select photostream (now icloud in the latest update) and my photo stream appears with the oldest photos first!  I want to see my newest photos, not scroll through h

  • AccessControlException: access denied

    I got a VERY simple client-server prog. On localhost it is working great...once you try to execute the client on other computer I get: "AccessControlException: access denied (java.net.SocketPermission, IP:5000 connect,resolve)" Actually it is a very

  • Avoid login while opening document from Document library

    Even though I loginned into Share point 2013 site, when i click on any document in the document library to open , it is asking again for Login. How can i avoid this.

  • Yahoo mail on my iMac

    I have successfully set up a Yahoo mail account on my new iPhone 4 but how do I set it up on my iMac?? It keeps telling me to visit Yahoo Mail Plus??