bebarth
Community Expert
bebarth
Community Expert
Activity
Jul 12, 2020
09:50 AM
Hi, The solution is to fit your document in a A0 format with the addWatermarkFromFile function and nScale parameter set at -1, then fill 4 A4 pages with the same function but nScale parameter set at 1.0, nVertAlign parameter at app.constants.align.top and moves the nVertValue parameter by 842 pts for each of the 3 other pages That works fine, I did the test. https://we.tl/t-Ul2sOkCrHk @+
... View more
Jul 06, 2020
01:38 AM
2 Upvotes
Hi, I would suggest to write in validation script of the 3 e-mail address fields: if (event.value==null || event.value=="") { event.rc=true; } else { if (event.value.match(/\S+@\S+\.\S{2,}/)==null) { app.alert("The input doesn\'t suit to the syntax required for an email address.\rPlease modify, example: firstname.lastname@supplyer.com"); event.rc=false; this.resetForm(event.target.name); } else { event.rc=true; this.getField("PortfolioCorrespondenceEmail1").insertItemAt(event.value,-1); } } That will add the new e-mail address at the top of the combo box. You can improve the script to check if the e-mail address already exist or to sort the combo box... @+
... View more
Jun 28, 2020
07:24 AM
1 Upvote
Is there a way to get the name of the bookmark we are clicking on? thanks
... View more
Jun 28, 2020
04:21 AM
You can find several examples I did on a French forum. Here are the links of 2 posts: http://abracadabrapdf.net/forum/index.php/topic,3859.msg24258.html#msg24258 and the example file http://abracadabrapdf.net/forum/index.php?action=dlattach;topic=3859.0;attach=4975 or http://abracadabrapdf.net/forum/index.php/topic,3999.msg25390.html#msg25390 and the example file http://abracadabrapdf.net/forum/index.php?action=dlattach;topic=3999.0;attach=5462 don't hesitate to contact me in PM if you don't understand and need more help. @+
... View more
Jun 27, 2020
11:58 AM
1 Upvote
Yes, it is possible using for example a csv attached file into your pdf form. You have to use the getDataObject function to read the data of the attached file. You can for example initialize a dropdown field including all ID, then when you choose one ID, all other fields are automaically filled. It is also possible to fill the csv sheet from the pdf fields with the setDataObject function. Please let me know if you need more information. @+
... View more
Apr 21, 2020
08:37 AM
Thanks for your help.
... View more
Apr 21, 2020
08:11 AM
Do you mean "U+FEFF" is the charset to indicate for the cMIMEType parameter?
... View more
Apr 21, 2020
07:10 AM
...and the result for a short file is: What can you deduce?
... View more
Apr 21, 2020
05:45 AM
Do you know how to read the hex codes on Mac?
... View more
Apr 21, 2020
05:43 AM
Hi, You seem to be a specialist and must certainly be right. For my part, I don't understand a lot about these types of formats and I therefore try to find a solution for my script. Do you have a good cMIMEType parameter to set directly the creating of the data object? Thanks
... View more
Apr 21, 2020
05:12 AM
...Sorry, but I don't understand how can I look at the hex codes! After a lot of testing, here is what I found: Example #1 with the Tom's script -> works fine. Example #2 where I add some accentuated characters to the special characters of the first script -> createDataObject("Example2.Txt", "Some ascii text then, ©™Σ plus éèàôùïîÉÈÁÀ","text/html; charset=utf-16") -> works fine too. Example #3 where I only indicated the accentuated characters -> createDataObject("Example2.Txt", "Some ascii text then, éèàôùïîÉÈÁÀ","text/html; charset=utf-16") -> doesn't work anymore. So I decided to do an Example #4 where I add these special characters to my variable in end of the script before creating the txt data object and that works fine (why ????). After several other tests I found I can add only one of these characters (©™Σ) at the beginning or at the end of my variable for working fine. Any explanation? So, for my script, I found the solution which is to create the txt dataobject with these symbols (or just one) then to fill it with my variable and streamFromString then setDataObjectContents. Thanks for reading and providing comments on this post.
... View more
Apr 21, 2020
02:01 AM
Thank you for your answer. Opening the txt file with Excel, the Windows (ANSI) setting suits to display the characters correctly. In a firs step, I know the setting to use, but I don't understand what's happening with the text stored in a variable. Is there a way to set the txt created attached file correctly. Thanks
... View more
Apr 20, 2020
09:45 AM
Hi, I come back on this post because I have a trouble. When the characters are written in quotes such as your example, that woks fine. When the characters are placed into a variable, that works fine too: var myVariable="Some ascii text then, ©™Σ"; createDataObject("Tst2.Txt", myVariable,"text/html; charset=utf-16"); In the script I'm writting, the variable is built all along the script and recalled at the end to fill the .txt file. In the screenshot attached, you can see the variable (lesDonnees) is correctly displayed when recalled in the console, but the special characters are not correctly displayed in the .txt file while the cMIMEType parameter seems to be correctly set! Do you have any idea on what's happening? Thanks
... View more
Apr 18, 2020
12:12 AM
1 Upvote
Great! That works very well... The "cMIMEType" parameter is not very well documented in the api reference! Thanks again Tom. @+
... View more
Apr 17, 2020
09:58 AM
1 Upvote
Thank you for your answer Tom! "Use "utf-16"" -> That doesn't work neither. "However, why are you using a stream? The "createDataObject()" function takes a string as input." -> Because I haven't thought about that! But the result is the same... However, I found a solution. I attach a txt file already utf-16 formatted then I fill that file. That works fine... @+
... View more
Apr 17, 2020
12:15 AM
1 Upvote
Thank you very much for your fast help!
... View more
Apr 16, 2020
10:14 PM
Hi, Could you please chage my Adobe community help name with my pseudo bebarth instead of my mail address. Thanks in advance
... View more
Apr 16, 2020
10:31 AM
1 Upvote
I wrote a script to merge the data of different form in a cvs file attached to a document. Everything works fine, execpt for the accented characters which don't appear correctly in the .csv file. For exporting the data, I use the util.streamFromString with utf-8 setting. I tryed all other setting but no one is correct. Is there a way to export correctly the accented characters? FYI, merging data with the Acrobat tool works fine. Thanks for your answer.
... View more
Jan 16, 2020
12:52 PM
oups! too late...
... View more
Jan 16, 2020
12:46 PM
Hi, here is a script you can use for counting the number of links in your document: var nbLinks=0; for (var p=0; p < this.numPages; p++) { var zone=this.getPageBox("Crop", p); var theLinks=this.getLinks(p, zone); nbLinks+=theLinks.length; } console.println("Number of links in this document: " + nbLinks); @+
... View more
Jan 13, 2020
12:08 PM
bonjour, Ne peux-tu pas insérer une page vierge après la page 1 ? Pour une réponse en français, tu peux passer sur : https://abracadabrapdf.net/forum/index.php/ @+
... View more
Dec 23, 2019
05:13 AM
Hi Thom, Sorry for this late answer. dialog.insertEntryInList({ "LST1" : { "abc" : -1 } }); works very well. I also discovered we can add a separator with: dialog.insertSeparatorEntryInList("LST1"); Are there any other useful tips like that? Is it possible for example to write an item in color? Thanks @+
... View more
Dec 20, 2019
10:12 AM
A simple way... when we master the util.printf method! 🙂 @+
... View more
Dec 19, 2019
04:37 AM
Hi, You must write: if(v == "Response to Unlawful or Suspicious Activity") and place the script in "calcul" of the field if you wish keep "event.target.required". Else you place the script in mouse up of the drop-down field, but you will have to use "this.getField("UCR Offense1").required"= true/false. You need to tick "Commit on selection change" (I don't know the exact name in English). @+
... View more
Dec 18, 2019
11:04 PM
Hi, The Math.round function rounds a number to the nearest integer. • for a decimal number <.5, the number is rounded down (so 1.25 is rounded to 1) • for a decimal number >=.5, the number is rounded up (so 3.75 is rounded to 4) For limiting a number to an integer: • for an unlimited number, you just have to control the key you are clicking, so put this script in "custom key script": var regxp=/^[0-9]$/; if(!event.willCommit) { if(event.change.length>0 && regxp.test(event.change)==false) event.rc=false; } • for a limited number (5 for example here below), you also have to check and limit the number, so the script will be: if(!event.willCommit) { var regxp=/^[0-9]$/; var aRslt=event.value.split(""); aRslt.splice(event.selStart, event.selEnd-event.selStart, event.change); var strTest=aRslt.join(""); var rpat=/^\d{0,5}$/; event.rc=rpat.test(strTest) && (event.change=="" || regxp.test(event.change)); } else { var rpat=/^\d{0,5}$/; event.rc=rpat.test(event.value); } @+
... View more
Dec 18, 2019
01:55 PM
1 Upvote
You are twice right! 1) I answered fron my phone and I didn't check the script and it is effectively wrong. I though it was the one I gave. 2) No need to add “if (event.value==""”... I checked! However, that's what I do every time. @+
... View more
Dec 18, 2019
04:08 AM
Like that, the script fill the field only if it is empty, so the date will not change if there is already one indicated in the field. @+
... View more
Dec 18, 2019
03:19 AM
Like that the date will change each time the file is open at an other date... @+
... View more
Dec 18, 2019
01:08 AM
1 Upvote
Hi, I will not answer to the first question, but I don't think it is possible to lock the "Save" Menu function. For the 2nd question, place this script in calcul of each date field: if (this.getField("CheckBox").value!="Off") { if (event.value=="") event.target.value=new Date(); } else { event.value=""; } these field must set with a date format. @+
... View more
Dec 17, 2019
12:06 PM
Hi, In a first step, try with: ... if (LicenseFee=='') { ServiceFee=''; ... @+
... View more
- « Previous
- Next »