Expand my Community achievements bar.

breakBefore method not working

Avatar

Former Community Member

I want to insert a page break using scripting but can't get the breakBefore method to work.

Not working:

root.sub2.breakBefore.targetType = "pageArea"

root.sub2.breakBefore.target = "#Page2";

I get the error: "subform does not have property 'breakBefore'."

The deprecated method break.before is working:

root.sub2.break.before = "pageArea";
root.sub2.break.before.target
= "Page2"


However, I don't want to use the deprecated break.before method as it causes compability problems with our print supplier, probably because the method is not supported.

Can anyone help?
Documentation: help.adobe.com - breakBefore

1 Reply

Avatar

Level 8
root.sub2["#breakBefore"].targetType = "pageArea";


root.sub2["#breakBefore"].target = "#Page2";

xfa.layout.relayout();

Give that a shot.

Kyle