Unlock the power of Acrobat SDK through our community.
Recently active
I have a question about radio buttons.I've been searching the sea of the net for two days just following problem, but no hint has fallen anywhere.Please help me !! ===== Based on a certain calculation, I would lile to make a javascript that automatically checks radio button.The "true side radio button" if the result is true, and "false side radio button" if the result is false.I don't get caught in debugging, and it doesn't appear alarm.But it doesn't work. ======== First, I created a script that looks like this:But it does not react at all. var Ave1 = this.getField("Ave_1").value;var Ave2 = this.getField("Ave_2").value;var RadioAve = this.getField("Radio_Ave").value;if (Ave1>=Ave2){RadioAve[0].checked = true;}else{RadioAve[1].checked = true;} ======== Next, I tried with the following script.I created a separate button and placed the script there.This also does not react. var RadioAve = this.getField("Radio_Ave").value;RadioAve[0].checked = tr
I've built an Acroform in Acrobat DC Pro. There are two linked dropdown lists, the 2nd (Subcategory) dependent on the 1st (Category). A javascript defines both the first list's items and the corresponding list's items as well. Here's the script, in the Custom Format Script of the field Category: var dependentListBoxFieldName = "Subcategory"; var dependentListValues = { "Computer": [ ["-Select-", "-Select-"], ["Desktop", "Desktop"], ["Laptop", "Laptop"], ["Smart phone", "Smart phone"], ["Tablet", "Tablet"], ["Other", "Other"] ], "Hardware": [ ["-Select-", "-Select-"], ["Headset", "Headset"], ["Keyboard", "Keyboard"], ["Monitor", "Monitor"], ["Mouse", "Mouse"], ["Printer", "Printer"], ["Scanner", "Scanner"], ["Other", "Other"] ], "Software": [ ["-Select-", "-Select-"], ["AV app", "AV app"], ["Browser", "Browser"], ["Email app", "Email app"], ["Media app", "Media app"], ["Office app", "Office app"], ["Social app", "So
Capturing meta-data from Document Properties into a Dynamic Stamp FieldI'm creating a dynamic stamp to display current meta-data from the open document. (This is part of a review process. Each person reviewing modifies certain custom meta-data within the document properties, then uses the Stamp to 'lock' that meta-data into a visible 'sticker' on the PDF. We are mimicing an important paper-based process.) My dynamic stamp contains approximately six fields. What javascript do I put into the form's Text Field Property custom calculation?
I used the following code in Properties Calculate to make a date field visible if "yes" is the selected choice from a dropdown list. The code works perfectly until the form is opened in Acrobat from a smart device, in my case an iPhone. The date field then fails to become visible when "yes" is selected in the dropdown list. All help with this appreciated as I have 30 date fields in my form if (this.getField("approved1").value == "yes"){ event.target.display = display.visible;}else{event.target.display = display.hidden;}
Hi, first off... I really don't have much familiarity with javascript. That being said, I've read some of the articles online about how to create the save as javascripts and trusted folders. I don't understand all of it but I've been able to piece some things together.I'm trying to implement a way to perform a Save As to a shared network folder with a filename based on the values of various fields within the open PDF.I've been able to do this with a button in the PDF by creating the following javascript and placing it in the trusted folder:mySaveAs = app.trustPropagatorFunction(function(doc,path) {app.beginPriv();doc.saveAs(path);app.endPriv();})myTrustedSpecialTaskFunc = app.trustedFunction(function(doc,path) {// Privileged and/or non-privileged code aboveapp.beginPriv();mySaveAs(doc,path);app.endPriv();// Privileged and/or non-privileged code below});Then adding a button on the PDF and adding the following javascript to the button:// build file namevar myFileName = getField("BRANCH_N
I have a form for teachers to mark attendance for students at either live or online classes. There are 16 possible classes for students to take and they have the option to take any given class either live or online, so I adapted a script from Javascipt for Tri State Button Please Help to let teachers mark attendance for each class as either "live" (checkmark), "online" (star), or "not attending" (blank). Here is the adapted button script I am running (I use "J" in AdobePi font to make a star symbol):if (event.target.buttonGetCaption()=="\u2714") { event.target.buttonSetCaption("J");} else if (event.target.buttonGetCaption()=="J") { event.target.buttonSetCaption("");} else if (event.target.buttonGetCaption()=="") { event.target.buttonSetCaption("\u2714");}Right now I have the attendance buttons for the first student named "a1", "a2", etc. The second student would probably be "b1", "b2", etc.What I would like is to have is a column fo
I have 13 individual fields on a document that cannot be blank. Due to the way the form is used, I have added a button at the bottom that says 'validate content' and it runs the following when the button is pressed. This works well, but it's obviously checking each field individually and giving separate error messages. How do I get it to check all 13 fields at once and give the error message as one list of empty fields and mark the fields with a coloured border? var patternEmpty = /^\s*$/; var strMissing = ""; if(patternEmpty.test(this.getField("User.USER_EMPLOYEENUMBER").value)) strMissing = "User Employee Number"; else { // All is ok, submit the data console.println("All form data ok"); } if(strMissing.length) {// Got an error app.alert("Missing Form data in field: Code V.1 " + strMissing); } var patternEmpty = /^\s*$/; var strMi
On my template page, I have a field that is a "Page __ of __" field that should auto-populate when the user creates a new template page. The 1st 6 pages of my 12 page file are intro information, and then page 7 is where the first 'add a page' button is, which calls forth the "T1 template", which spawns as page 8. Yet both of these pages have the Page blank of blank.So to illustrate, page 7 starts with Page 1 of 1. When the user hits the 'add a page' and generates page 8, page 7 should be Page 1 of 2, and page 8 should be Page 2 of 2. Then when they hit the button again on the newest page, page 7 should be Page 1 of 3, page 8 should be Page 2 of 3, and page 9 should be Page 3 of 3, and etc etc.So the code I have so far for the "add a page" button on page 7 (and this one seems to be working fine as it's a specific increment with non-changing field names) is:var SpawnPage = this.getTemplate({cName: "T1"});SpawnPage.spawn({nPage: pageNum + 1, bRename: true, bOverlay: false});this.pageNum++
Hi..newbie to the forums as well as javascript in a pdf. I have a pdf with some very specific functionality...One of the pages has a form, with 10 different rows of data that each have their own reset button per line (illustrated below). In addition to that, this same page has a button which is supposed to duplicate this same form page again (with different fieldnames) so the user can enter an additional 10 lines of data, then click that same button to spawn yet another new page if needed, and so on and so on. As shown, each row consists of 7 input boxes, then a 4 option radio button set, then 2 more inputs, then another 6 option radio set. As if that wasn't enough, each of the individual radio button COLUMNS, and the last 2 input field COLUMNS, get tallied and totaled at the bottom, and those 'total' numbers each have to also be carried through (no matter how many of these pages the user spawns), and that total total has to appear on yet ANOTHER page of the file in a 'total total tota
Hello!I want to start off by saying that I have limited to no experience directly with JavaScript, but do have basic programming knowledge of VBA and Java.I am working on automation within an on-boarding document for new employees where the only requirements are:a) When a signature field is signed off on, mark off a check box in the document;b) Display "Not Complete" if all check boxes have not been checked off from a signature;c) Display "Complete" if all check boxes have been checked off;d) If possible, prevent document from being submitted via e-mail until the document is marked as complete.Any help is appreciated. Even getting task "a" working is huge progress!Thanks,Jeff
Hi, I have one pages PDF form & i want to make 100 duplicates with unique field names. looks like bellow button code will work but i want to do it in once click. also after making 100 pages, i want to delete the buttons. anybody can help me to do it ??. thanks..this.spawnPageFromTemplate("GMFT");
I have 2 ButtonsThe first Button is called "UPS ON0.0" with the choices "ON" and "OFF" and I want it to be seen at all timesWhen Button is in the "OFF" position I want to hide the second button.The second button is called "UPS IN0.0" with choices "INVERTER" and BYPASS"When first button is "ON" I want the second button to show.Please help me. I have very very basic programming skills and am trying to build a form for my team taking rounds
I'm trying to figure out how to have one drop down menu's options affected by another drop down menu's options.So for example Box A drop down has options 1, 2, 3, 4If I choose option 1 I want box B drop down to have options Red and blue, but if I choose option 2 I want the box B drop down to have Green and yellow.I cannot remember what options to choose if anything, and need help figuring out what properties I need to change, or how to edit the script.
var f = this.addField("myfield","text",0,[0,792,126,770]); f.borderColor = color.black; f.textSize=12; f.textColor=color.black;It works fine but positions the text field in the top corner of the page, whereas with LiveCycle it was simple to make a new field below an existing one, then another each time the button was clicked. Can anyone help me with this please?
Hi I'm creating a form which requires the comparison of two cells to show a cash saving. I would like to change the colour of the text in the savings cells/column based on whether they are equal to or less than zero. The default colour if greater than 0 should be green.I have spent a while trawling the internet for a solution that works and whether the JS info should be in the calculation or in the validation. I have successfully got this calculation working. But cannot for the life of me suss the colour - I got close but alas no cigar.(function () {// Get field values as numbers var v1 = +getField("Competitor1.0").value; var v2 = +getField("OurPrice1.0").value; var v3 = +getField("Quantity1.0").value;// calculate this field value event.value = v3 * (v1 - v2);})();My questions are as follows- How do I create the colour script?- Where should it be used (in the calculation/validation areas)?Any help much appreciated.
I'm trying to store the filepath and filename of several PDFS in an array. I'm using the action wizard and executing the code below.if ( typeof global.zArray == "undefined" ) {global.indexCnt = 0;global.zArray = new Array();}var path2file = this.path;var re = /.*\/|\.pdf$/ig;var filename = path2file.replace(re,"");var filepath = path2file;global.zArray[global.indexCnt] = [filepath,filename];global.indexCnt++;I tried viewing all the elements in the array after all the files processed using the code below, but it only prints the last filepath and filename in the folder.for (i=0;i<global.zArray.length;i++){console.println(global.zArray);}What am I doing wrong??
I have an array of objects that need to be persistent. I have read that saving complex data can't be done as is but can be saved if in a string format. Any help in this area will be greatly appreciated. Also is there a special location to make this data persistent ie: global.setPersistent()?
Hi, is there a way to set fields to be required field and have the user fill out the required field before moving on to next field?
Hi all, I have a simple script that flattens a page. It works well. I just want to add a command so that the document saves once the page has been flatten:function Flatten(boolCurrentPageOnly) // Takes a boolean argument{if (boolCurrentPageOnly) // Flatten either this page... { this.flattenPages(this.pageNum); app.execMenuItem("Save") //That's where I inserted the new command. All works fine otherwise. Except that it doesn't save the doc. }else { this.flattenPages(); &
I am trying to find a script that will delete all spawned pages, regardless of the number of pages. I want to be able to set the document back to original. The number of spawned pages may vary.
I have a program I am writing that has parts that interact with acrobat. When a user that does not have acrobat is running the program on their machine it crashes when they try to access a form that imports the acrobat libraries. Is there a way to check for acrobat and display a message to the user if they do not have acrobat?
I entered the script below which works but not perfectly. If COT or POT is picked from the drop down list I want the WO text field to be blank, which it does. If 'Vacation' is picked the WO number "3071070" populates to the text field. The problem is if the user changes their mind from Vacation to COT the WO number does not disappear. Is there something I can put in the quotes to tell it I actually want a blank text field? Thank you!!// Place Absence Data into Pay Type Description and WO Fieldsvar AbsenceData = { "Vacation":{WO: "3071070",PayTypeDesc: "Vacation" }, "COT":{ WO: "", PayTypeDesc: "COT" }, "POT":{ WO: "",PayTypeDesc: "POT" }, "Stat Holiday":{ WO: "3071070",PayTypeDesc: "Stat Holiday" }, "Sick":{ WO: "3071080",PayTypeDesc: "Sick" }, "Family Sick":{ WO: "3071080",PayTypeDesc: "Family Sick" }, "Sick No Pay":{ WO: "3071080",PayTypeDesc: "Sick No Pay" },
Guys, I have a pretty simple question, but I've no idea about writing command in JS.The thing I'm trying to do is to print in a textbox the last five digits of another textbox. Something like this:in my first textbox, I have this serial number: FTFYIOI66779995, and I want to print the last 5 digits: 79995 in other textbox.Hope I explained myself right And thanks for your help
I'm still a little new to PDF javascripting. Is there a javascript to insert another pdf file into an existing PDF file when a user chooses a drop down menu item?I have a template with a drop down menu, and when a user clicks on that menu item I would love for the corresponding PDF be inserted into that template. Would that be possible or would that be too difficult? I am using adobe acrobat pro DC. Thank you in advance!
Guten Tag liebe UsersGerne möchte ich mehrere Dateien mit einem Javascript an den Drucker senden. Vorher aber den Druckmanager anzeigen lassen, damit ich die Papierauswahl anwählen kann.Für eine Hilfe danke ich im Voraus.Freundliche Grüsse
Remix with Firefly Community Gallery
Thousands of free creations to fall in love with and remix in Firefly.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.