Unlock the power of Acrobat SDK through our community.
Recently active
In this automatic culvert size calculator, I would like the correct culvert size to be automatically selected from the heading culvert sizes dropdown list and the checkbox array opposite the culvert discharge area: ie. in the image the checkbox opposite the 800 culvert should be selected and 800 should be selected from the drop-down list. In the image of the form, the Aavg field was calculated using the 'average' calculation function, however, I would prefer if the value was the mean of the values that are greater than 0 or null, so as an error isn't caused by a failure to enter a full six measurements.
I have a bunch of PDF that I need to add a long document javascript in them. I want to use an action to inject it to a bucnh of PDF.I have found this steps on StackOverflow (provided Joel Geraci):- - - - - Create a new Action Select "More Tools" Select "Execute JavaScript" The script your action runs will need to inject the JavaScript that you want the PDF to run as a string. You'll need to give it a name ("init" in this case) so it appears in the "Document JavaScripts" list. So it will look like this... this.addScript("init", "app.alert('Hello World');")- - - - -Works perfectly on a small code to inject. But I can't figure out how to us ethe same steps to includes a long multiline javascript. I have try a few things like defining a variable but it keep failing. How can I write a long multiline code to be injected using the: this.addScript("init", "[code here]")
I have a large PDF (320 pages) and need to extract and save individual pages as separate files. I search on a keyword in the file, locate the page(s) I need, and then extract these pages from the master document (without deleting). EVERY SINGLE time the 'BROWSE for FOLDER' dialog box forces me to scroll and expand my folder tree, for a total of SIX CLICKS (plus a lot of scrolling in a little tiny box) to reach the destination folder. I'm on Windows 10 and this was not my experience extracting pages in the previous versions of Acrobat. I have searched on how to set or change the default output folder and/or how to force Acrobat DC to 'see' that I just used a particular folder, and to present that recently accessed folder as the default destination after the first time I've extracted a page from a PDF. At the very least, I would expect the default output directory to be that of the document from which I'm extracting the pages (which it's not). I had hoped I could change the output f
I need assistance to write a script for my GST calculation based on the selection of radio button: GST Excl (radio button) is selected - 10% must be added over the subtotal GST Free )radio button is selected - no gst is calculated GST Incl (radio button ) is selected - subtotal must be divided by 11 (i am almost giving up my hopes as this may be too ambitious) . I have learned adobe all by myself but just stuck on this form for ages.
I built VBA code to run through a query list of PDF files, open the first file, add some watermark text, save it to a specific path and filename, THEN open each subsequent PDF from the query list sequentially and add watermark text, then insert the watermarked PDF copy into the first saved file. Everything works great when there are only 2-6 pages. I have query lists in the 300+ files (for 400+ pages). The code below fails with Run Time Error 91 at the GETJSObject line. The real head scratcher for me is that this error SEEMS to be speed/processor dependent in that it happens at different times on the same list. Sometimes failing at page 10, sometimes at page 284. Always at the GETJSOBject line (at least that's where the Access VBA shows it failing).Any suggestions??Code:Public Sub PDF_PRINT_HIDDEN(path, parent, TSO, setqty, itemno) Dim PDFApp As AcroApp Dim PDFDoc As AcroAVDoc Dim newPDFDoc As AcroAVDoc Dim PDDoc A
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
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.