Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


Sets page break expression.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 11.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.SetPageBreakExpression"; PDF; Expression )   More


Parameter Description Example
PDF The PDF reference returned from DynaPDF.New. $pdf
Expression The expression to use.


Returns OK or error.


Sets page break expression.
We can calculate this expression when the text box is full in a function call with DynaPDF.WriteFText, DynaPDF.WriteFTextEx, DynaPDF.WriteStyledText or DynaPDF.WriteStyledTextEx.
The expression can call other functions like DynaPDF.AppendPage, DynaPDF.EndPage and DynaPDF.SetTextRect of course.

Please make sure your expression does not cause an endless loop or recursion.

You can return in your expression what should happen with next text. Return -1 to cancel write operation.
If you like to change alignment for next block, return 1 for left alignment, 2 for right alignment, 3 for center alignment or 4 for justify alignment.

You can use DynaPDF.GetLastTextPosY to know where the text of the last text block ended.


Set the page break expression:

Set Variable [ $r ; Value: MBS("DynaPDF.SetPageBreakExpression"; $pdf; "Let ( [

$CurrentColumn = $CurrentColumn + 1;

t = If ( $CurrentColumn < $ColumnCount ;

    Let ( [
        $PosX = $StartPosX + $CurrentColumn * ($ColumnWidth + $Distance) ];
    0) ;

    Let ( [
        $PosX = $StartPosX;
        $CurrentColumn = 0;
        a = MBS( \"DynaPDF.EndPage\"; $pdf);
        a = MBS( \"DynaPDF.AppendPage\"; $pdf; 1)];

a = MBS( \"DynaPDF.SetTextRect\"; $pdf; $PosX; $PosY; $ColumnWidth; $ColumnHeight )
]; 0 )") ]

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

Created 15th December 2020, last changed 23th February 2024

DynaPDF.SetPageBBox - DynaPDF.SetPageCoords