DynaPDF.SetTextDrawMode
-----------------------

Sets text draw mode.

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

MBS( "DynaPDF.SetTextDrawMode"; PDF; Mode ) 

**MBS**( **"DynaPDF.SetTextDrawMode";** /\* Sets text draw mode. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Mode**) /\* The new text draw mode.e.g. "Invisible" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Mode | The new text draw mode. | "Invisible" |

### Result

Returns OK or error.

### Description

Sets text draw mode.  
The text draw mode specifies how text should be rendered. Texts can be used as clipping paths such as normal vector graphics; however, the usage is not the same. To use a text as clipping path save the graphics state, set the text draw mode to a clipping mode, paint the objects which should be clipped into the path and restore the graphics state.   
Note that the functions DynaPDF.BeginClipPath and [DynaPDF.ClipPath](DynaPDFClipPath.md) can not be used to define a text as clipping path.   
Default value = Normal  
  
| Draw Mode | Description |
|---|---|
| Normal | Default, render the text in the usual way. The fill color is used as the text's color. |
| Stroke | Tread the glyph outlines as path to be stroked. The current line width and stroke color are used to paint the path. |
| FillStroke | Tread the glyph outlines as path to be stroked and filled. The current line width, fill color, and stroke color are used to paint the path. |
| Invisible | Neither fill nor stroke the text, the text is invisible. |
| FillClip | Tread the glyph outlines as path to be filled and add this path to the current clipping path. The settings of the current line width and fill color are used to paint the path. |
| StrokeClip | Tread the glyph outlines as path to be stroked and add this path to the current clipping path. The settings of the current line width and stroke color are used to paint the path. |
| FillStrokeClip | Tread the glyph outlines as path to be stroked and filled and add this path to the current clipping path. The settings of the current line width, fill color and stroke color are used to paint the path. |
| Clipping | Tread the glyph outlines as path and add this path to the current clipping path. |

See also [SetTextDrawMode](https://www.monkeybreadsoftware.com/DynaPDF-Manual/SetTextDrawMode.shtml) function in DynaPDF manual.

### Examples

Set stroke draw text mode:

 MBS ( "DynaPDF.SetTextDrawMode"; $pdf ; "Stroke" )  
Draw some text with outline only:

 # 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) \]   
\# and draw text   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetFillColor](DynaPDFSetFillColor.md)"; $pdf ; 0; 0; 1) // 100% blue \]   
Set Variable \[ $r ; Value: MBS ("DynaPDF.SetTextDrawMode"; $pdf ; "Stroke") \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.WriteText](DynaPDFWriteText.md)"; $pdf ; 100; $x ; $text ) \]  
### See also

- [DynaPDF.ClipPath](DynaPDFClipPath.md)
- [DynaPDF.GetTextDrawMode](DynaPDFGetTextDrawMode.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.SetFillColor](DynaPDFSetFillColor.md)
- [DynaPDF.SetFont](DynaPDFSetFont.md)
- [DynaPDF.WriteText](DynaPDFWriteText.md)

### Blog Entries

- [PDF Draw Modes](https://www.mbsplugins.de/archive/2025-09-25/PDF_Draw_Modes/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 6.0pr8](https://www.mbsplugins.de/archive/2016-01-26/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 22nd January 2016 , last changed 24th September 2025

  
[DynaPDF.SetTemplBBox](DynaPDFSetTemplBBox.md) - [DynaPDF.SetTextFieldValue](DynaPDFSetTextFieldValue.md)

[HTML Version](DynaPDFSetTextDrawMode.shtml)