Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
The function measures the height of a formatted text block.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
The PDF reference returned from DynaPDF.New. | ||
Align | The text alignment. Can be left, center, right or justify. | "left" |
Text | The text to write. | "Hello World" |
Returns height or error message.
See also GetFTextHeight function in DynaPDF manual.
Place text centered on page:
# top down coordinates
Set Variable [ $r ; Value: MBS("DynaPDF.SetPageCoords"; $pdf; "TopDown") ]
# get the styled text to place
Set Variable [ $FileMakerText ; Value: Create Text::Text ]
# convert to Formatted Text for DynaPDF
Set Variable [ $FText ; Value: MBS( "DynaPDF.ConvertStyledText"; $pdf; $FileMakerText ) ]
# measure
Set Variable [ $Width ; Value: 400 ]
Set Variable [ $Height ; Value: MBS( "DynaPDF.GetFTextHeight"; $PDF; "left"; $FText ) ]
# lookup page size
Set Variable [ $PageWidth ; Value: MBS( "DynaPDF.GetPageWidth"; $PDF ) ]
Set Variable [ $PageHeight ; Value: MBS( "DynaPDF.GetPageHeight"; $PDF ) ]
# now center text on page
Set Variable [ $r ; Value: MBS("DynaPDF.SetTextRect"; $pdf; ($PageWidth - $Width) / 2; ($PageHeight - $Height) / 2; $Width; $Height) ]
Set Variable [ $r ; Value: MBS("DynaPDF.WriteFText"; $pdf; "left"; $FText) ]
This function checks for a license.
Created 18th August 2014, last changed 3th January 2021