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


Writes styled text on current page.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 6.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.WriteStyledTextEx"; PDF; PosX; PosY; Width; Height; Align; Text { ; LeadingFactor } )   More


Parameter Description Example Flags
PDF The PDF reference returned from DynaPDF.New. $pdf
PosX X-Coordinate of output rectangle $x
PosY Y-Coordinate of output rectangle $y
Width Width of output rectangle $w
Height Height of output rectangle or -1. $h
Align The text alignment. Can be left, center, right or justify. "left"
Text The text to write. "Hello World"
LeadingFactor Available in MBS FileMaker Plugin 11.0 or newer.
If you pass a value > 0, the plugin will add \LD[] commands to styled text to set leading relative to font size. This way you define the spacing beteween lines.
1.2 Optional


Returns OK or error.


Writes styled text on current page.
Converts for you the styled text to the formatted text commands from DynaPDF.
Use DynaPDF.GetFTextHeightEx or DynaPDF.GetFTextHeight to calculate the space needed for the text if you want to create a matching text rectangle for vertical alignment.

See DynaPDF.AllowPageBreak for whether to do page breaks or not.

Please set a font first with DynaPDF.SetFont function before you write on the page. As this function uses font settings from FileMaker field, it may ignore whatever font or style you loaded before.

Internally calls DynaPDF.ConvertStyledText and DynaPDF.WriteFTextEx.

MBS Plugin in version 11.5 with DynaPDF adds support for double underlined text.

See also WriteStyledTextEx function in DynaPDF manual.


Write styled text with rectangle:

# page size
Set Variable [ $pw ; Value: MBS("DynaPDF.GetPageWidth"; $pdf) ]
Set Variable [ $ph ; Value: MBS("DynaPDF.GetPageHeight"; $pdf) ]
# set black color
Set Variable [ $r ; Value: MBS("DynaPDF.SetFillColor"; $pdf; 0; 0; 0) ]
# write styled text
Set Variable [ $r ; Value: MBS("DynaPDF.WriteStyledTextEx"; $pdf; 100; $ph-100; $pw-200; $ph-200; "left"; Create Text::Text) ]

See also

Release notes

Blog Entries

This function checks for a license.

Created 13th October 2016, last changed 30th October 2021

DynaPDF.WriteStyledText - DynaPDF.WriteStyledTextExRotated