Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.5   8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1   9.2    Statistic  


Computes the width of a text string.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DynaPDF 5.0 Yes Yes Yes Yes Yes
MBS( "DynaPDF.GetTextWidth"; PDF; Text )   More


Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf
Text The text to measure. "Hello World"


Returns width or error.


Computes the width of a text string.
The graphics state parameters character spacing, word spacing, text scaling, and the current font size are all considered. A font must be set before this function can be used.
The function computes the visible width of the string. This is the width excluding the last character spacing. The bounding box of the string is the text width plus the current character spacing. This behavior must be taken into account when writing right aligned text with DynaPDF.WriteFText. Due to certain formatting rules DynaPDF.WriteFText uses the bounding box of a text string to output text.

See also GetTextWidth function in DynaPDF manual.

See also

Blog Entries

Created 12nd November 2014, last changed 12nd November 2014

DynaPDF.GetTextScaling   -   DynaPDF.GetTransparentColor

Feedback: Report problem or ask question.

MBS Xojo Plugins