5 Replies Latest reply on Nov 15, 2017 10:10 AM by Thom Parker

    Acrobat Custom Keystroke Script

    j.massie

      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

        • 1. Re: Acrobat Custom Keystroke Script
          Joel_Geraci Adobe Community Professional

          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?

          • 2. Re: Acrobat Custom Keystroke Script
            j.massie Level 1

            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!

            • 3. Re: Acrobat Custom Keystroke Script
              Joel_Geraci Adobe Community Professional

              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.

              • 4. Re: Acrobat Custom Keystroke Script
                JR_Boulay Adobe Community Professional

                The issue may be the way that the richValue is being copied over to the other field.

                This is the case.

                When using the RTF format, line breaks are always lost in duplicated fields, also when importing/exporting data.

                 

                I reported this bug about 3 years ago to Adobe (july 2014).

                I'm still waiting for the fixup…

                 

                • 5. Re: Acrobat Custom Keystroke Script
                  Thom Parker Adobe Community Professional

                  I remember this one from way back.  Rich text was never well used, so it just doesn't get updated.  You know there are a whole bunch of undocumented span attributes. There's an amazing set of text/paragraph formatting parameters,. They are however poorly supported, as well as not being documented.  Adobe has dropped the ball on a lot of JS functionality, especially the fringe stuff