Page Break in Print Template with one Section

We generate some letters with dynamic text, onto a Print Template.

Reviewing similar forum posts, there does not appear to be an easy way to force a page break. Is there a standard symbol, special character, reserved word, html tag etc, which I can place on a page, which will cause the page content to be rendered on new page?

I’d prefer to keep only one section, which spans multiple pages, rather than attempt to use 2 sections, one which prints the top of the text, and one which prints the bottom of the text.

Thoughts?

My reason for doing this is to intentionally support plain Engish text on the front of the letter, and switch to other languages (for instance Arabic, French, Mandarin) dynamically on the back of the letters.

The plan is to have the text contain the full content of the letter, but have page breaks to jump to the next page before rendering the next language.

Hi @iwest,

Can you please explain how the text does arrive at the Print Template? Will it for example be provided as a single string or by multiple strings whereby each string contains a paragraph?

The text arrives as a part of an XML data record.

<letterData>
...
<miscText>
  <line>Paragraph1</line>
  <line>Paragraph2</line>
  <line>Paragraph3</line>
  <line>Paragraph4</line>
   ...
</miscText>
...
</letterData>

HI @iwest,

Thank you for sharing an example.

Adding the result of each “line” XML node to a new paragraph element (<p></p>) doesn’t result in the expected result? For this you can add the following element to a Print Context Section:

<p id="example"></p>

And use a Standard Script like, for example:

Name: Example
Selector: p#example

var result = "";

if ("lines" in record.tables) {
	for (var i = 0; i < record.tables["lines"].length; i++) {
		var field = record.tables["lines"][i].fields["line"] ;
		
		if (field !== "") {
			result += "<p>" + field + "</p>";
		}
	}
}

results.replaceWith(result);