Unlock the power of Acrobat SDK through our community.
Recently active
I have a problem that drives me crazy.In my PDF I use a function that fills the right drop-down menu and depends on the choice made in the left drop-down menu.This function works well except that: - When I use my function in "validation script" it acts with a delay time, it is the previous choice that is displayed in the right drop-down list. )See attachment). - When I use my function in "custom format script" it runs twice. ( See attachment.)• Once when you click on the list, as if there was a "mouse down" action, which immediately resets the right drop-down list.• And a second time, as expected, when you validate a choice. What do I need to change to be able to use my function as a "validation script" that don't acts with a delay time, or as a "custom format script" that only runs once after the user choice? Thank you My function: function gereSousList() { if (event.target.currentValueIndices != 0) {// console.clear();// récupération du suffixe du champ cliq
I've found many different similar options but most of what I've found are severely dated. I am using Adobe Acrobat Pro DC. I have 6 numeric text fields and in the 7th field I need to create a custom script to display the highest/greatest/Max number between those 6 fields. The field titles are: SeptSteps (user input number)OctSteps (user input number) NovSteps (user input number) DecSteps (user input number) JanSteps (user input number) FebSteps (user input number) TotalSteps (Read Only, need to display highest number of the previous 6) Could anyone please assist? Thanks in advance!
Using javascript , it's possible to set all the Appearance options to multiple text fields using hierarchic names. But I noticed that I can't do this for any of the General (readonly) or Options options (multiline true/false or defaultValue). I'm trying to have a functions that create three text fields with specific attributes. Here my code... Maybe I'm approaching it the wrong way and shall create one field and duplicate it using javascript. But I don't know how (yet! 🙂 ) addField("jv.n", "text", this.pageNum, [18, 18, 582, 162]); addField("jv.m", "text", this.pageNum, [18, 186, 582, 330]); addField("jv.0", "text", this.pageNum, [18, 354, 582, 498]); var fNa = ("jv"); var f = this.getField(fNa); f.textSize = 10; f.textFont = "Courier"; f.textColor = color.black; f.fillColor = ["G", 0.9]; f.display = display.visible; f.multiline = true; f.doNotScroll = false; f.doNotSpellCheck = true; f.readonly = true; f.defaultValue = "JavaScript - description: "; this.resetForm
Hello,When I create a Barcode field with PDF417 Symbology, I noticed that the fields content are automaticly sorted when I scan it. This when using Encoding Tab delimited or the Custom Calculated Script provided by Acrobat.Does the only solution is to rename the fields so they appears in the correct sorted order?Thanks!
I want to add Five Fields (numeric) and also allow user to enter "-" (dash sign) if no value is present instead of 0. but when i put "-" in any field it returns NaN. Following is my script : var n1 = Number(this.getField("Text1").valueAsString);var n2 = Number(this.getField("Text2").valueAsString);var n3 = Number(this.getField("Text3").valueAsString);var n4 = Number(this.getField("Text4").valueAsString);var n5 = Number(this.getField("Text5").valueAsString); event.value = n1+n2+n3+n4+n5; Thanks in advance [moved by moderator to Acrobat from Community Help.]
Hi, I'm trying to make an Javascript button event that will send an email and a PDF form. I have the form properly emailing, and the subject line is dynamically updated with whatever is in the field "What do you want the report to show or compare" but I can't figure out what to enter to make the body of the email read the same thing every time. I just need it to run a little disclaimer for the submitter and it'd read something like "Click send to complete form transmission" I have tried cBody and cMsg but don't know how to get those to both work. If it matters, I'm trying the cBody after the cSubject. I am very new to Javascript. Thanks.Here is what I have working so far: "this.mailDoc({cTo: "example@work.com",cSubject: this.getField("What do you want the report to show or compare").valueAsString});"
Is it possible to batch process using a JavaScript that will reduce all the documents images dpi down to 150 dpi then resave the file in a different location? Any snippets of code for reducing the image dpi or other parts of this task would be greatly appreciated!
Hopefully this makes sense! On my sales contract, I have two 'control' buttons. Button 1 checks that all mandatory fields have been completd and if necessary gives an error message listing the fields that still need completing. If all fields are completed, no error message appears when the button is pressed and the salesperson can continue (document does not get submitted anywhere). Button 2 makes the document read only, apart from a handful of fields and hides some other fields. Both buttons work fine, BUT because the salesperson can potentially skip/ignore button 1 and just press button 2, I've been asked to do the following but as JS is still very unknown to me, I'm stuck. Request 1. Document cannot be made read only until all mandatory fields have been completedI'm thinking that button 2 should be hidden and only appears when all mandatory fields are completed. Open to other suggestions for this.This is the code currently on button 1 (button 1 is called HI
Hello!I have used a document javascript to make an auto go to next field and it works perfectly right on desktop but does not do anything on Mobile using Reader (Android or iOS). Does something like that is completely impossible on Mobile?I have this in my doc script: function tab_next(next_field_name) { if (event.willCommit || AFMergeChange(event).length === event.target.charLimit) { getField(next_field_name).setFocus(); } } and use this for keystroke script: tab_next("name of next field"); Please tell me it’s possible to accomplish something similar on Mobile and how. Thanks!
Hi,I am trying set and get ( this.getPageBox("BBox"); ) bouding box in acrobat javascript. I know that Bbox is readyonly and cannot set it manually. But I am putting some invisible white text at the bottom of page and making bouding box large. The problem is that acrobat does not read the new larger bouding box if the document edited stay open but detect changes when the same document is closed and reopened again. Can someone please help me in how to solve this? Thank youArvind
I've downloaded the Adobe SDK and read through the Developing Plug-ins and Applications documentation. I've also got the sample plugins that came packaged with the SDK. However, none of this seems to have the answer to my issue. I need to disable the right-click menu on Adobe and I'm not sure how to do this. I've been able to add menu items to the menu bar and take items off. Just can't figure out how to modify the right-click. Also, I've seen the post on this forum where you can disable the right-click by running some commands from Powershell. I need to do this programatically, if possible.
I have stumbled into a nice on OpenPage javascript that automatically set the focus on the first field to be filled. Nice. if (typeof x == "undefined") { var x = 1 var premier = this.getField("T1"); premier.setFocus(); } But why the if statement to check for var x? What does it do exactly? I can get the same results without it by using only teh last two lines.
Hello,Using setAction(cTrigger, cScript) I’m able to send javascript to a bunch of fields using hierarchale ("txt") naming like in (txt.0, txt.1, txt.2, etc.). This works fine for: Keystroke, Validate, Calculate, Format but will not do it for MouseUp/MouseDown/MouseEnter/MouseExit/OnFocus/OnBlur. For theses I need to specify the full name of the field.This is my test javascript executed form the console. Is this a limitation? a Bug? or is there a workaround? var cScript1 = "app.beep(0);" var cScript2 = "app.beep(0);" var cScript3 = "app.beep(0);" var cScript4 = "app.beep(0);" var cScript5 = "app.beep(0);" var cScript6 = "app.beep(0);" var cScript7 = "app.beep(0);" var cScript8 = "app.beep(0);" var cScript9 = "app.beep(0);" var cScript10 = "app.beep(0);" var f = this.getField("txt"); f.setAction("MouseUp", cScript1); f.setAction("MouseDown", cScript2); f.setAction("MouseEnter", cScript3); f.setAction("MouseExit", cScript4); f.setAction("OnFocus", cScript5); f.se
I noticed that if I add a menu item (with a .js in the user folder) in the main Help menu, the first app.response will not let me enter any text. If I place that script in any other main Acrobat menu, it works. My guess it's because the Help menu already contain a search entry. That the only difference between this menu and the others. Am I riht with that finding? Try with this sample code: function alertMe(){ var cMsg = app.response("Enter the message:"); var cMsg2 = app.response("Enter the message2:"); app.alert (cMsg+cMsg2); } // app.addMenuItem({cName:"Alerte Me!", cParent:"Help", cExec:"alertMe();" }); Is their a workaround this?
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");
Remix with Firefly Community Gallery
Thousands of free creations to fall in love with and remix in Firefly.
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.