Stefan Cameron on Forms
Building intelligent forms using Adobe LiveCycle Designer

Tip: Inserting Line Breaks in Text

Did you know that you could insert a line break, as opposed to a paragraph break, in between two lines in a text object using the [Shift + Enter] keyboard sequence?

When editing the contents of a text object, pressing the [Enter] key will produce a paragraph break which means that any Above and/or Below Spacing you have specified will come into effect, amongst other paragraph formatting-related properties. Under the hood, the effect is the insertion of a “new line” character (\n) in a plain text object or a new <p> tag in a rich (XHTML) text object.

Sometimes, however, you need to break a line without producing a new paragraph. For example, you might have a long URL to insert and, given its position within the contents, it ends-up being broken onto another line and you would prefer to keep it on a single line, yet part of the same paragraph. To do this, use the [Shift + Enter] keyboard sequence. The result is a “soft” break to another line without moving to a new paragraph. Under the hood, this translates into the insertion of a U+2029 Unicode break character in plain text or a <br> tag in rich (XHTML) text.

Those of you using a version of Designer which precedes the 8.2.1 release should note that when using [Shift + Enter] in a plain text object, the contents of the object gets converted into rich text since previous versions of Designer would always use the <br> tag to denote a line break. Designer 8.2.1 coincided with the release of Acrobat/Reader 9.0 which provided improvements to the Text Engine in order to support the plain text U+2029 Unicode break character.

Line Breaks in Acrobat/Reader

What I describe above relates to the authoring experience in Designer. Inserting line breaks (as opposed to paragraph breaks) while filling a form in Acrobat/Reader is different. John Brinkman explains the “why and how” in this post.

Sample Form

Download Sample [pdf]

I have included a sample for that demonstrates the different types of breaks in both plain and rich text objects. I also included a text field that has a multi-line rich text caption (the contents of the rich text object) and a multi-line default value (the contents of the plain text object), both using paragraph and line breaks. (If you’re wondering how I got those values into the caption and default value properties, I used good old Copy & Paste in both cases.)

Minimum Sample Requirements: I authored this sample using Designer 8.2.1.2 and Acrobat 9.3. It should work back to Acrobat 9.0. I’m unsure of the results in earlier versions of Designer and Acrobat due to the use of the U+2029 character in plain text.


Posted by Stefan Cameron on January 29th, 2010
Filed under Acrobat,Designer,Tips,XFA
Both comments and pings are currently closed.

Comments are closed.