DynaPDF.WriteText
-----------------

Writes text on current page.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [3.1](newinversion31.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.WriteText"; PDF; PosX; PosY; Text ) 

**MBS**( **"DynaPDF.WriteText";** /\* Writes text on current page. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$PosX**; /\* X-Coordinate of the texte.g. $x \*/   
**$PosY**; /\* Y-Coordinate of the texte.g. $y \*/   
**$Text**) /\* The text to write.e.g. "Hello World" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| PosX | X-Coordinate of the text | $x |
| PosY | Y-Coordinate of the text | $y |
| Text | The text to write. | "Hello World" |

### Result

Returns OK or error message.

### Description

Writes text on current page.  
Please set a font first with [DynaPDF.SetFont](DynaPDFSetFont.md) function before you write on the page.  
See also [WriteText](https://www.monkeybreadsoftware.com/DynaPDF-Manual/WriteText.shtml) function in DynaPDF manual.

### Examples

Write something:

 MBS ("DynaPDF.WriteText"; $pdf ; 111; 323; Invoice::Invoice ID)  
Draw text over rectangle:

 # where?   
Set Variable \[ $x ; Value: 100 \]   
Set Variable \[ $y ; Value: 100 \]   
\# the text   
Set Variable \[ $text ; Value: "Some blue text" \]   
\# set the font before measuring   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetFont](DynaPDFSetFont.md)"; $pdf ; "Helvetica"; 0; 12) \]   
\# measure now   
Set Variable \[ $width ; Value: MBS ( "[DynaPDF.GetTextWidth](DynaPDFGetTextWidth.md)"; $pdf ; $text ) \]   
\# draw rectangle width some addition 5 point margin   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetFillColor](DynaPDFSetFillColor.md)"; $pdf ; ,8; ,8; ,8) // light gray \]   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.Rectangle](DynaPDFRectangle.md)"; $pdf ; $x - 5; $y - 5 - 2; $width + 10; 5 + 12 + 5; "fill") \]   
\# and draw text on top   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetFillColor](DynaPDFSetFillColor.md)"; $pdf ; 0; 0; 1) // 100% blue \]   
Set Variable \[ $r ; Value: MBS ("DynaPDF.WriteText"; $pdf ; 100; $x ; $text ) \]  
Write checkmark:

 Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetFont](DynaPDFSetFont.md)"; $pdf ; "Zapf Dingbats"; 0; 12) \]   
Set Variable \[ $r ; Value: MBS ("DynaPDF.WriteText"; $pdf ; 100; $x ; Char(10004)) // "✔︎" \]  
### See also

- [DynaPDF.FindText](DynaPDFFindText.md)
- [DynaPDF.OpenOutputFile](DynaPDFOpenOutputFile.md)
- [DynaPDF.SetColorSpace](DynaPDFSetColorSpace.md)
- [DynaPDF.SetFillColor](DynaPDFSetFillColor.md)
- [DynaPDF.SetTextDrawMode](DynaPDFSetTextDrawMode.md)
- [DynaPDF.TestWriteText](DynaPDFTestWriteText.md)
- [DynaPDF.WebLink](DynaPDFWebLink.md)
- [DynaPDF.WriteDemoText](DynaPDFWriteDemoText.md)
- [DynaPDF.WriteFText](DynaPDFWriteFText.md)
- [DynaPDF.WriteFTextEx](DynaPDFWriteFTextEx.md)

### Example Databases

- [DynaPDF/Add Page Links](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Add%20Page%20Links.shtml#2ScriptAnchor_)
- [DynaPDF/Bookmarks](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Bookmarks.shtml#2ScriptAnchor_)
- [DynaPDF/Create Text as PDFA](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Create%20Text%20as%20PDFA.shtml#3ScriptAnchor_)

### Blog Entries

- [Create PDF/UA with DynaPDF in FileMaker](https://www.mbsplugins.de/archive/2026-05-27/Create_PDFUA_with_DynaPDF_in_F/monkeybreadsoftware_blog_filemaker)
- [PDF Draw Modes](https://www.mbsplugins.de/archive/2025-09-25/PDF_Draw_Modes/monkeybreadsoftware_blog_filemaker)
- [Add page links for FileMaker](https://www.mbsplugins.de/archive/2022-06-18/Add_page_links_for_FileMaker/monkeybreadsoftware_blog_filemaker)
- [Things you can do with DynaPDF](https://www.mbsplugins.de/archive/2021-07-02/Things_you_can_do_with_DynaPDF/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 5/2021, Seite 26](https://filemaker-magazin.de/neuigkeit/4158-Appetithappen-FMM_202105)

This function checks for a license.

Created 18th August 2014 , last changed 25th February 2026

  
[DynaPDF.WriteStyledTextExRotated](DynaPDFWriteStyledTextExRotated.md) - [ECKey.BuiltInCurves](ECKeyBuiltInCurves.md)

[HTML Version](DynaPDFWriteText.shtml)