Skip to main content
j.massie
Participating Frequently
November 14, 2017
Question

Acrobat Custom Keystroke Script

  • November 14, 2017
  • 1 reply
  • 1774 views

Hi

Would anyone be able to help?

I have a form field that has Rich Text enabled. When the page closes the .richValue of this field is copied and reused somewhere else in the form.

It all works great, all the values, font, font size etc is carried over except for line breaks. All the text is placed on the same line.

Unless! you click Shift+Enter when you want to go to the next line. However I can't expect the forms users to know to do this. Would anyone be able to provide me with a custom Keystroke Script so that when the Return/Enter Key is pressed on the keyboard it actually inserts a line break.

Many thanks for any help!

Jon

This topic has been closed for replies.

1 reply

Joel Geraci
Community Expert
Community Expert
November 14, 2017

Line breaks do get inserted when Return/Enter Key is pressed. The issue may be the way that the richValue is being copied over to the other field. Can you supply that code and a sample PDF that exhibits the behavior?

j.massie
j.massieAuthor
Participating Frequently
November 14, 2017

Thank you for your reply.

I am am away from my computer until tomrrow, but will be very happy to provide a sample pdf tomorrow.

I have tried a few different ways, one being

getField(“TextField2”).richValue = getField(”TextField1”).richValue;

Which works except the line breaks are not brought over. Where the line breaks should be there is nothing, so the last character of the last word on line 1 is right up against the first character of the first word of what should be on the second line.

However if I use Shift+Enter instead of just enter, the .richValue is copied over identically.

Im sure there must be a way of doing that automatically though, I can’t expect the form fillers to do this.

Thanks again!

Joel Geraci
Community Expert
Community Expert
November 14, 2017

I'll take a look. I think the problem is that Acrobat stores it's own wrapping as breaks too and when copying the richValue to another field, it tries to help you in case the fields are different sizes and removes them. I'm sure there's a way to keep them though. I just need to figure it out.