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  


Writes styled text on current page.

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


Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf
Align The text alignment. Can be left, center, right or justify. "left"
Text The text to write. "Hello World"


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.


Write some styled text on a PDF page:

Set Variable [$pdf; Value:MBS("DynaPDF.New")]
#Add page
Set Variable [$r; Value:MBS("DynaPDF.AppendPage"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.SetFont"; $pdf; "Helvetica"; 0; 12)]
#Write some text
Set Variable [$pw; Value:MBS("DynaPDF.GetPageWidth"; $pdf)]
Set Variable [$ph; Value:MBS("DynaPDF.GetPageHeight"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.SetFillColor"; $pdf; 0; 0; 0)]
Set Variable [$r; Value:MBS("DynaPDF.SetTextRect"; $pdf; 100; $ph-100; $pw-200; $ph-200)]
Set Variable [$r; Value:MBS("DynaPDF.WriteStyledText"; $pdf; "left"; Create Text::Text)]
#End page
Set Variable [$r; Value:MBS("DynaPDF.EndPage"; $pdf)]
#Render one page as Picture
Set Variable [$PDFData; Value:MBS("DynaPDF.Save"; $pdf; "hello.pdf")]
Set Variable [$r; Value:MBS("DynaPDF.Release"; $pdf)]
#Put in Container
Set Field [Create Text::PDF; $PDFData]

See also

Example Databases

Blog Entries

Created 13th October 2016, last changed 8th January 2018

DynaPDF.WriteFTextExRotated   -   DynaPDF.WriteStyledTextEx

Feedback: Report problem or ask question.

MBS Xojo tutorial videos