Copy link to clipboard
Copied
Hello, I need help with making an interactive PDF.
I'm new to this so I'm not sure how much of this is possible to do, but I would appreciate some help!
1) I need the font size in both left and right boxes to be set at 14pt and then to gradually reduce to fit the size of the box depending on the amount of text.
2) I would also like the text on the right hand column to be Red and 14pt font, unless the first word is "Perfect." the word perfect should be this shade of blue. Or for the box to automatically show a blue "Perfect." if the Grade is "A" (not sure which is easier to do).
Thank you in advance!
Copy link to clipboard
Copied
1) You can't do it "gradually" while the text is filled in, unless you set the font size to Auto. You can set the font size after the text was entered to a desired value, based on its length, though.
2) Changing the color of a single word in a field is possible, but complicated. It requires setting it up as a Rich Text Formatted field and then applying the value as an array of Span items (two, in this case).
The second option you mentioned is much easier to implement, and can be done via the Validation event of the Grade field.
Copy link to clipboard
Copied
1) If I set it to Auto, can I set it so that it always begins with 14pt?
2) Could you talk me through the second option (validation event of the grade field)?
And I've run into another problem, if you could help me with that, I would appreciate it!
If the sentence starts with Suggested Answer : , to have those first two words and the colon to be italicized.
Thank you so much for your help!
Copy link to clipboard
Copied
1. No.
2. Add this as the custom validation script of the Grade field (let's say the feedback field is called "Feedback1"):
var f = this.getField("Feedback1");
if (event.value=="A") {
f.value = "Perfect";
f.textColor = color.red;
} else {
f.value = "";
f.textColor = color.black;
}
3. This requires the same kind of complicated solution as having only one word in a different color than the rest of the text.
Copy link to clipboard
Copied
Hello, thank you again for your help!
It doesn't seem to be changing the font color for me. What could I be doing wrong? I changed the field name to the field with the letter grade.
var f = this.getField("1Grade1");
if (event.value=="A") {
f.value = "Perfect";
f.textColor = ["RGB", 0, 0.5, 1]
} else {
f.value = "";
f.textColor = color.black;
}
Copy link to clipboard
Copied
The code seems fine. So after you select something that's not A and enter some text into the field, it's not in black?
Copy link to clipboard
Copied
Hello,
Yes, below is a screenshot.
> 1Grade1 shows A. The text is still red.
Thank you!
Copy link to clipboard
Copied
You change the color of field "1Grade1", not "1F1".
Copy link to clipboard
Copied
Sorry, I think I'm a little lost. But it also turned out that "A" isn't always "Perfect" on the grading scale, so I need to edit the form again. I think I'll post them on a separate post. I appreciate your help!
Copy link to clipboard
Copied
I ran into a similar problem, so thanks for the help!