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

DynaPDF.GetTextBBox

Calculates the exact bounding box of a text string.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 14.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.GetTextBBox"; PDF; Text )   More

Parameters

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

Result

Returns list or error.

Description

Calculates the exact bounding box of a text string.
The bounding box is computed from the outline of every glyph. However, the function does not consider the current text draw mode or bold or italic font style emulation.
Returns the rectangle x1, y1, x2 and y2 values as a list. Using dot for decimal separator.

Examples

Query text bounding box for some text:

Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ]
Set Variable [ $r ; Value: MBS("DynaPDF.AppendPage"; $pdf) ]
Set Variable [ $r ; Value: MBS("DynaPDF.GetTextBBox"; $pdf; "Hello World") ]
Show Custom Dialog [ "Text rectangle" ; $r ]

See also

Release notes

Blog Entries

This function checks for a license.

Created 3th October 2024, last changed 3th October 2024


DynaPDF.GetTemplWidth - DynaPDF.GetTextDrawMode