Quantcast
Channel: Adobe Community: Message List - PDF Forms

Re: PDF text field to be flip horizontal

0
0

It is possible when you use a special font.


Re: Want round down all results

Re: Bouton dans Acrobat

0
0

Qu'appelez-vous "sélectionner" ?

Avec ce script le bouton alterne entre les deux couleurs à chaque clic.

 

Avez-vous un exemple ou une maquette à partager ?

copy entered field

0
0

In a form fillable form, is there a way to copy the same field to other locations in a multi page document without having them re-enter the same information

Re: form calculations don't work, calculation boxes grey'd out

0
0

Can you write your calculation in either Simplified Notation or JavaScript?

Re: Can't redact?

0
0

I noticed that docs with an eSign, can't redact. Anyone know why?

Re: Want round down all results

0
0

Thank you for your response.

 

Your example is:

 

1.2 becomes 1.0

1.7 becomes 2.0

 

I want it to always round down:

 

1.2 becomes 1.0

1.7 becomes 1.0

Re: copy entered field

0
0

So sounds like you want to have for example, a "name" field on every page. The use enters their name once and it's automatically copied to all the "name" fields on the form? 

 

If this is what you mean, then you're in luck. Just give all the same fields the same name. All fields with the same name are actually the same field, so they all share the same value. The user enters data in one place and it's copied to all the other fields with the same name.


Re: Want round down all results

0
0

use the Math.floor() function

 

var a = 1.7;

var b = Math.floor(a):

 

Now b = 1.0

Re: Adobe Acrobat DC denies field calcualtion input / selection

0
0

Did you look in the console window for any reported errors?

Here's a video on using it:

https://www.pdfscripting.com/public/images/video/AcroJSIntro/AcroJSIntro_ConsoleWindow.cfm

 

The first thing I would do it make sure the calculation script is working properly.

To do this, first create the calculation script with JavaScript, the last calculation option

Next, add a console.println() (explained in the video) to the bottom of the script  to display the result.

 

Something like this

 

event.value = this.getField("Fld1").value + this.getField("Fld2").value;

console.println("Result:" + event.value);

Re: PDF text field to be flip horizontal

0
0

The special font is a good idea, but it fails when I add to it.  As an example 1234 displays 4321 then adding + 1 = 5321.   Adding one adds to the most left digit. 

Also 9321+1 = 0421

Re: Want round down all results

0
0

Yes, awesome. Now how do I incorporate my equation "(FIELD1 - 10) / 2" into that? Would it be the "a" variable?

 

Like this??

 

var a = (FIELD1 - 10) / 2;

var b = Math.floor(a):

 

Again. I really appreciate all your help. I'm so clueless when it comes to this.

 

Nic

Re: PDF text field to be flip horizontal

0
0

Since these aren't really decimal numbers but reversed digit strings you'd have to reverse, do arithmetic, reverse again.

Re: Want round down all results

0
0

If you want the final result to be rounded down, then yes, your code is correct.

But if this is a calculation script, then it should be:

 

event.value = Math.floor((FIELD1 - 10) / 2);

Re: PDF text field to be flip horizontal

0
0

As far as I can tell there are no properties or methods available in JavaScript, or basic field parameters that will flip either a field value or a page for printing.  But there are some options.

 

1. For the special font - I assume this is a flipped font. You can't change the order of the actual field value, or as you've seen, it won't work correctly in a calculation.  To fix this, reverse the text the format event. That way it's only displayed flipped.

 

2. This is something that could be more easily done with an Acrobat plug-in.  Such a plug-in could flip text in a specific field. or flip an entire page for printing.

 

3. There actually is a way to do this with JavaScript using an undocumented function. However, it only works with the standard Type 1 fonts. This method is a way to show a field input or calculation result flipped.  

 

Contact me if you are interested in #2 or #3


How to Auto-populate pricing that allows custom pricing as well?

0
0

Hi, First, to say I know nothing about writing Javascript is an understatement so I apologize for my lack of knowledge and hope someone can help me out with this problem. I am using Adobe DC to create an order form.

 

What I am trying to accomplish is to auto-populate a price that the user can also change to a custom price by typing over the set price. So in all my research from the forum, I finally came up with something that comes close to working but still has enough issues that makes it where I can't use it.

 

I have a drop down item list that has 100s of items and the values for each I made unique like 60, 60.0, 60.00, 60.000 as a suggestion from another post from George Johnson. Those values are pricing for the drop down items.

 

I also put the script he gave in the calculated field and then combined that with some other random script that I found from another post which added a check box to turn off or on the script.So what I ended up putting in the custom calculation script is:

 

if (this.getField("CheckBox1").valueAsString!="Off") event.value = getField("PRODUCT.1").value

 

It surprisingly worked as far as if I check the box, it gets the value in the PRODUCT.1 field and when unchecked it will allow a user to overwrite that pricing with their own. So then after a few test I noticed the "Total price" field which is supposed to multiple the quantity by the price goes off to some random number that doesn't add up, for example Quantity is 3, price is 40, and it totals as "1499.00. This occurs after I change the pricing a few times.

I'll keep looking for an answer, but for those of you who know coding, you can probably tell how for off I am with the correct way this should be. lol Thanks in advance for reading my question, and I hope you can help out!

Re: How to Auto-populate pricing that allows custom pricing as well?

0
0

How does you calculate the total?

Re: Can't redact?

0
0

You can't change signed documents.

Re: Want round down all results

0
0

Now I'm confused.

 

Do I use?

event.value = Math.floor((FIELD1 - 10) / 2);

 

or?

var a = (FIELD1 - 10) / 2;

var b = Math.floor(a):

 

Neither of them seem to work for me.

 

This is the error when I put it in the bottom box "Custom Calculation script" If I put the "event.value = Math.floor((FIELD1 - 10) / 2);" in, I don't get the error but I also don't get any results in the field1

xxzx.png

I tried these each in the second or third window in this pic and no joy on them working.xxz.png

I tried both of these in and they don't work.

 

This is so frustrating for something that, to me, should be a simple function. Could you please type out everything as I need to enter it into the Javascript editor box? Which box do I put it in? I'm sorry but I'm ignorant of how to use this language.

Re: Button and Javascript

0
0

Hi ... I think I need more help and/or suggestion to see how this can work ..

If I am trying to link 3 events fields together, with the 3rd fields having information that will be auto-populated.

Hope the example below help to explain what i am trying to achieve .. thanks in advanced!!

 

For Eg:

Field 1 contains categories like:

i) (Display options) Fruits

ii) (Display options) Meats

 

Field 2 after field one has been selected:

i) (selected) Fruits -->   i) (Display options) Citrius Fruits

                                   ii) (Display options) Non-Citrius Fruits

ii) (selected) Meats-->  i) (Display options) Red Meat

                                   ii) (Display options) White Meat

 

Field 3 will auto-populate based on what have been selected in Field 2

i) (selected) Citrius Fruit --> (auto-populate) Lime, Lemon, Orange

ii) (selected) Non-Citruis Fruits --> (auto-populate) water-melon, honey dew

Re: Want round down all results

0
0

Use ; not : at the end of the statement.

Re: Bouton dans Acrobat

0
0

Bonjour,

Avec le script, et les options cochées, le bouton ne rechange pas de couleur de mon côté si l'on reclique dessus une deuxième fois.

Je vais revérifier si j'ai pas fait une erreur.

 

J'appelle le fait de sélectionner, le fait de cliquer dessus.

 

C'est un document interne donc c'est un peu délicat de le partager.

 

L'idée est d'avoir un rectangle blanc avec un mot dedans noir, et lorsque l'on clique dessus, ce dernier passe en couleur bleu, et le texte en blanc, et si l'on reclique dessus il repasse en noir sur blanc.


Re: Button and Javascript

0
0

You can use dropdown lists for this.

Re: Bouton dans Acrobat

0
0

Effectivement, la détection par les couleurs ne semble pas fonctionner.

 

Alors j'ai fait autrement, en me basant sur le contenu de l'infobulle :

 

// si l'infobulle contient 2 espaces
if (event.target.userName == "  ") {    event.target.fillColor = color.blue;  // fond bleu    event.target.textColor = color.white;  // texte blanc    event.target.userName = "";  // infobulle = rien
} 
// sinon
else {    event.target.fillColor = color.white;  // fond blanc    event.target.textColor = color.black;  // texte noir    event.target.userName = "  ";  // infobulle = 2 espaces
}

 

Exemple fonctionnel à télécharger ici : Adobe Document Cloud

Re: Adobe fill and Sign: how to change add a signature

0
0

Thank you SO much for this! I was going crazy trying to make that stupid button work. Thank you again!!!

Re: How to Auto-populate pricing that allows custom pricing as well?

0
0

Good morning,

 

Under the in the "Total Price" field properties, under Simplified Notations I have, (PriceEachRow1)*QuantityRow1

 

Note: I just went in and copied the script, and then deleted/closed it, went back in and pasted it, and then every test I have done this morning so far works with a correct multiplication.

 

 

Bernd, thank you! Also, if any of you think I will have issues with my form later, please let me know. I am still a little surprised the check box is working right now. lol

Re: How to Auto-populate pricing that allows custom pricing as well?

0
0

I just sent the form to my phone which has an Adobe Acrobat app and while it worked on my desk top, when I select a product, iit keeps the last price and doesn't change it.

Re: How to Auto-populate pricing that allows custom pricing as well?

0
0

Acrobat Reader for mobile devices doesn't support all features.

Re: How to Auto-populate pricing that allows custom pricing as well?

0
0

Thank you. Is there anything else I can do? The script without the check mark worked great on my phone it was only when I added the check box to disable the autopopulate that caused it not to work.


Re: Want round down all results

0
0

As Bernd points out, the ":" is the cause of the syntax error. In JavaScript, lines end with the semi-colon ";".

 

But you have another issue. Where does "Field1" come from? I just assumed you were using this as a place holder for a real field value.  But in the JavaScript calculation you need the real value. Is this the name of a field? If it is then use this code in the calculation (third box down in the calculation tab)

 

var val1 = this.getField("FIELD1").value;

event.value = Math.floor((val1 - 10) / 2);

 

This code will also work in the console window for testing.

Fillable Form with Signature and Adding Password Encryption After Filled. Possible?

0
0

I created a fillable PDF form that requires a digital signature. If I send this PDF out to someone who can fill it out with confidential information and have them sign it, is there any way that they can add a password protection on it when they email it back to me? We need to practice HIPAA laws, and this seems difficult to integrate it. I am open to other methods where our clients can easily fill out this form to return back to us with a password. Can anyone offer suggestions please? Thanks!

Re: Fillable Form with Signature and Adding Password Encryption After Filled. Possible?

0
0

If digital certificates are used to sign the form the contents of the PDF are locked and any changes can be identified. This will also mean you need to collect the public certificate copy that was used to sign the form

Re: PDF text field to be flip horizontal

0
0

Since I can make this work with the digits going the proper direction.   I believe I just need to reverse the digits prior to utilizing the reverse font.   But I am not sure of a way to reverse the string.   I have very limit luck trying to put the individual items into an array and the reversing it.  

I have tried getting the value into an array var.split("").reverse().join("");   No luck with reverse.  Split and Join might work.  It could be the value is treated as a number and not a string.

I have tried filtering getItemAt(0, false);

-- Trying to put this all into the "Custom Calculation Script" field.

Any thoughts?

Re: Fillable Form with Signature and Adding Password Encryption After Filled. Possible?

0
0

Even if the signature doesn’t lock the file, setting a password must, by design, destroy the signature. One thing is clear: it is absolutely unacceptable that a medical form is emailed.

 

You must use a secure server. It must run a script written by a qualified professional practicing all the current security measures.

Re: PDF text field to be flip horizontal

Re: PDF text field to be flip horizontal

0
0

Your method for reversing works fine.

 

var strData = "abcd";

var strFlip = strData.split("").reverse().join("");

 

What problem are you having?


Re: PDF text field to be flip horizontal

0
0

Also, don't use the calculation script. Use the Format event script.

Calculate Max Score & Percentage

0
0

I'm trying to create a score sheet.  The maximum score for each item is 4.  Some lines could be not applicable to some people, so those lines will be empty.  I need a formula that will calculate the maximum score (<the number of fields filled> * 4).  After that, another field should calculate the score percentage, based on the total score & maximum score.  Can this be done?  I'm using Adobe Pro DC v2019.012.20040.

Re: PDF text field to be flip horizontal

0
0

Hi thanks,  I really appreciate the assistance.

But where do these format event scripts exist? 

Do I create a button and add an action on the mouse down to trigger a javascript?   if so I get TypeError: snData.split is not a function.

 

var snData = this.getField("SerialNumberStart").value;

var strFlip = snData.split("").reverse().join("");

this.getField("Serial Number Start.0.0").value = snData;

 

Or do I need to add it to the "document JavaScript" and link it to various buttons. 

Bill

Re: PDF text field to be flip horizontal

0
0

You'll find the format event script on the "Format" tab of the text field where the string you want to Flip is displayed. Select the Custom Format option. Then you'll see the script areas.

 

In your script, what is the value and data type of  "snData".

Run this code in the console window, one line at a time to see the answers

 

snData = this.getField("SerialNumberStart").value;

typeof snData

Re: Button and Javascript

0
0

Hi Bernd,

I have used checked-boxes for Field 1.

How do I code the selection into the 2nd Field?

How do I then code Field 3 to auto-populate based on Field 2?

 

Thanks in advanced for helping!!

Re: Want round down all results

0
0

Awesome!!!!!!!!!!!

 

That's it!!

 

Thank you so very much. Seems to be lots of work for such a simple thing. It's working perfectly. Thank you everyone for the help.

 

Nic

Re: Want round down all results

0
0

This is probably a stupid question. Is there a list of such scripts? Simple functions with examples, that are used in Acrobat? Of would I need to actually learn the whole Javascript shabang? Like a manual that is written specifically for acrobat?


Re: Want round down all results

0
0

The official Core JavaScript Reference is kept by Mozilla:

JavaScript | MDN

 

Much about JS on the web is about HTML JS. The core language is the same everywhere, but the application model is different. So you have to be careful about which part of a script applies to Acrobat. That said, there are many useful HTML scripts that can be converted to Acrobat JavaScript because they are mostly about core operations, such as rounding down.

 

You can learn specifically about JavaScript in Acrobat here:

pdfscripting.com

 

There's also a lot of info here (Search the JavaScript Tutorials):

https://acrobatusers.com/

 

Otherwise, you'll find lots of useful tidbits on scripting Acrobat on this forum and scattered around the web.

Re: How to Auto-populate pricing that allows custom pricing as well?

0
0

You should be able to do this in the Mobile Reader. There are a number of possible problems. Basically, the script is doing something that is not supported. You need to figure out what that thing is. To start off, create a simplified form that only contains the single feature that doesn't work. That way you know there is no other code that is affecting it. Then see how it works.

Re: How to Auto-populate pricing that allows custom pricing as well?

0
0

After a quick test, I found that "valueAsString" does not seem to be supported on the Mobile Reader. Change it to "value".

Re: Want round down all results

0
0

Thank you very much for all the help and the referenced information. I've got some learning to do.

Re: How to Auto-populate pricing that allows custom pricing as well?

0
0

I just checked this forum before I was going off to sleep and saw that you had answered! I was so excited, I got back out of bed to try the solution.  It worked! ! If you think there is a better way to accomplish this without a check box, please let me know. The check box itself isn't ideal for me and a few times when I would uncheck it, it would revert back to checked. Perhaps something I have wrong in the check box field. Anyway, it's exciting that it is working now and I thank you very much for that!

 

Bernd Your solution to fix the calculate field was also correct. I don't know what I had wrong as all I did was go in, copy, delete, close, go back in and paste it again and it worked after that. I need to be able to hit correct answer on two post with this one. lol

 

Thank you both!!

Re: Add an "Attach File" button to a PDF form.

0
0

Hi Try, thank you so much for clarifying 'refrying' a PDF which I was told was flattening during the training I received, which I now understand has not been good business practice.  I've had to to a lot of research and made some vast improvements since we've been introduced to Adobe, which works beautifully with the JavaScript I applied.  You've been super helpful throughout this for me and I can't thank you enough!  I did have struggles in the beginning trying to figure out how to copy and paste the information from the table on the PDF to excel, quickly and simply.  What I am currently doing works very well which I can keep doing, unless you have any better suggestions of how I am currently doing this, with my explanation below from beginning to end.

 

 

'The PDF was created from a Word Document with a table inserted where I have added text fields for data to populate, which needs to be copied and pasted from the PDF to excel.  I only need parts of the table to copy and paste from the PDF to excel and keep the formatting, formulas are not required.  There are several PDF's with lots of copying and pasting required daily.  I am able to copy and paste from the digitally signed and locked document, however it is very slow, so the only way I have found that is able to quickly copy and paste is to refry the PDF.  After that I hold down the Ctl key, use my mouse to select the data, right click and select copy with formatting, paste into excel and right click again in excel to change the font bigger.  I am now saving the digitally signed and locked PDF (not the refried one I have used to copy/paste) into our Master Filing System (edocs)'

Re: Calculate Max Score & Percentage

0
0

Yes, this can be done.

 

The part of this is to name your fields to make the job easy. And the easiest way to do this is to use group naming, which means you prefix all the field names with a group name.  So the score fields would be something like "Score.Item1", "Score.Item2", etc. All the score fields are prefixed with the word "Score". 

Here's code to find the number of Score fields that are not empty. 

 

// Get a list of all the Score Feilds

var aScoreFlds = this.getField("Score").getArray();

 

// Filter into a list of Score fields that are not empty

var aFilledScore = aScoreFlds.filter(function(a){return a.value != ""});

 

// Find Max Score

var nMaxScore = aFilledScore.count * 4;

 

//Find Total Score

var nTotal = 0;

aScoreFlds.forEach(function(a){nTotal += a.value});

 

// Find Percentage

var nPercentage = nTotal/nMaxScore;

 

These calculations can be divided between a Total field and a Percentage field like this.

 

/////  Total Score field (assume it's named "TotalScore")

var aScoreFlds = this.getField("Score").getArray();

var nTotal = 0;

aScoreFlds.forEach(function(a){nTotal += Number(a.value)});

event.value - nTotal;

 

/////  Percentage field

var aScoreFlds = this.getField("Score").getArray();

var aFilledScore = aScoreFlds.filter(function(a){return a.value != ""});

var nMaxScore = aFilledScore.count * 4;

 

event.value = this.getField("TotalScore").value/nMaxScore;






Latest Images