Copy link to clipboard
Copied
I am trying to create an adobe letter with form fields in different places of a sentence. Sometimes the data going to the field will only be 1 or 2 characters while other times the data going to the field will be 8 or 10 characters. I want the field to auto size in width without changing the font to auto. The sentence needs to be uniform in font and spacing so that the sentence looks like it is written correctly. How can I create an auto sizing form field?
Below is an example of one of the sentences. I have inserted spaces where I would have form fields.
Dear _____________,
You will be come into _______ as _______ and your function will be ____________.
Can we use variables into a form and fill the variables with the content of the field.
or If I use a new global field and I will build it into a script. how can i use all HTML code to be sure that the text paragraph or sentence will be ok
I try to add the proposal into the form.
I create hidden fields dans make some calculated fields.
when à take the form into servicenow and I ask to generate the PDF files The fields are not calculated.
somebody can help me ?
thx !
Copy link to clipboard
Copied
This is not possible in Adobe Acrobat.
Copy link to clipboard
Copied
You can’t use HTML for anything. What you describe might not be completely impossible, but it’s so hard that it might as well be.
Copy link to clipboard
Copied
The only way to do that in an Acrobat PDF form is if the entire text is a part of a single text field.
It's possible to set up a system where you would enter those variable texts into a dialog window, or even other text fields in the files, and it will automatically populate this field with the full text. However, that requires the development of a custom-made script.
Copy link to clipboard
Copied
Thx for your answer and support
I must to be creative and find another way to be able to have a fluent text.
I'm not allone to ask this functionality 🙂
Copy link to clipboard
Copied
This script assumes that there are 4 text fields (name, into, as and function) containing data in the document, which can possibly be hidden.
Place it as a calculation script in the large multiline text field that hosts the final text:
var strWord1 = this.getField("name").valueAsString;
var strWord2 = this.getField("into").valueAsString;
var strWord3 = this.getField("as").valueAsString;
var strWord4 = this.getField("function").valueAsString;
event.target.value = "Dear " + strWord1 +",\nYou will be come into " + strWord2 + " as " + strWord3 + " and your function will be " + strWord4 + "."
Copy link to clipboard
Copied
HI,
JR_BOULAY thx a lot for you help.
I will try it.
Philippe
Copy link to clipboard
Copied
Hi JR_boulay,
I have a question 🙂
event.target.value=....
what do you mean by target ?
can i create calculated field (multiple line)
"computed text"
multiple line
and in the calulated tab (custom calculation) (is it on the calulated tab ?
I put this script (without target)
var strWord1 = this.getField("name").valueAsString;
var strWord2 = this.getField("into").valueAsString;
var strWord3 = this.getField("as").valueAsString;
var strWord4 = this.getField("function").valueAsString;
event.value = "Dear " + strWord1 +",\nYou will be come into " + strWord2 + " as " + strWord3 + " and your function will be " + strWord4 + "."
THX !!!!
Copy link to clipboard
Copied
It shoule be event.value, not event.target.value ...
Copy link to clipboard
Copied
Yes, I'm sorry.
You can remove the "target" but it works fine in any case.
😉
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thx it's really what I want to do
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more