DynaPDF.RoundRectEx
-------------------

The function draws a rectangle with elliptical corners.

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

MBS( "DynaPDF.RoundRectEx"; PDF; PosX; PosY; Width; Height; RadiusWidth; RadiusHeight; FillMode ) 

**MBS**( **"DynaPDF.RoundRectEx";** /\* The function draws a rectangle with elliptical corners. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$PosX**; /\* X-Coordinate of rectanglee.g. $x \*/   
**$PosY**; /\* Y-Coordinate of rectanglee.g. $y \*/   
**$Width**; /\* Width of the rectanglee.g. $w \*/   
**$Height**; /\* Height of the rectanglee.g. $h \*/   
**$RadiusWidth**; /\* The radius for width.e.g. 20 \*/   
**$RadiusHeight**; /\* The radius for height.e.g. 30 \*/   
**$FillMode**) /\* Fill mode. Can be FillNoClose, StrokeNoClose, FillStrokeNoClose, Fill, Stroke, FillStroke, FillEvOdd, FillStrokeEvOdd, FillEvOddNoClose, FillStrokeEvOddNoClose, NoFill or Close.e.g. "fill" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| PosX | X-Coordinate of rectangle | $x |
| PosY | Y-Coordinate of rectangle | $y |
| Width | Width of the rectangle | $w |
| Height | Height of the rectangle | $h |
| RadiusWidth | The radius for width. | 20 |
| RadiusHeight | The radius for height. | 30 |
| FillMode | Fill mode. Can be FillNoClose, StrokeNoClose, FillStrokeNoClose, Fill, Stroke, FillStroke, FillEvOdd, FillStrokeEvOdd, FillEvOddNoClose, FillStrokeEvOddNoClose, NoFill or Close. | "fill" |

### Result

Returns OK or error.

### Description

The function draws a rectangle with elliptical corners.   
The parameter RadiusWidth must not be greater than the half width of the rectangle and the parameter RadiusHeight must not be greater than the half height of the rectangle.  
If the coordinate system is bottom-up the point PosX, PosY defines the lower left corner of the rectangle. If the coordinate system is top-down it defines the upper left corner.  
The draw direction can be changed with the function [DynaPDF.SetDrawDirection](DynaPDFSetDrawDirection.md).  
A rectangle is a closed path that can be filled, stroked or both. It is also possible to draw a rectangle invisible to apply the filling rules nonzero winding number or even-odd. The filling rules are described under [DynaPDF.ClipPath](DynaPDFClipPath.md). The parameter FillMode is ignored if the rectangle is drawn inside a clipping path. The fill modes are described under [DynaPDF.ClosePath](DynaPDFClosePath.md).  
See also [RoundRectEx](https://www.monkeybreadsoftware.com/DynaPDF-Manual/RoundRectEx.shtml) function in DynaPDF manual.

### Examples

Draw blue round rectangle width different x/y radii:

 Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetStrokeColor](DynaPDFSetStrokeColor.md)"; $pdf ; 0; 0; 0) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetFillColor](DynaPDFSetFillColor.md)"; $pdf ; 0; 0; ,8) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetLineWidth](DynaPDFSetLineWidth.md)"; $pdf ; 5) \]   
Set Variable \[ $r ; Value: MBS ( "DynaPDF.RoundRectEx"; $pdf ; 100; 100; 300; 200; 30; 20; "fillStroke" ) \]  
Draw page number inside a round rectangle box:

 # set color white to fill and light gray for frame   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.SetStrokeColor](DynaPDFSetStrokeColor.md)"; $pdf ; ,1; ,1; ,1) \]   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.SetFillColor](DynaPDFSetFillColor.md)"; $pdf ; 1; 1; 1) \]   
\# draw round rect with one point border   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.SetLineWidth](DynaPDFSetLineWidth.md)"; $pdf ; 1) \]   
Set Variable \[ $r ; Value: MBS ( "DynaPDF.RoundRectEx"; $pdf ; 50; $pageHeight - 50; $pageWidth - 100; 30; 5; 5; "FillStroke" ) \]   
\#   
\# set color black   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.SetStrokeColor](DynaPDFSetStrokeColor.md)"; $pdf ; 0; 0; 0) \]   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.SetFillColor](DynaPDFSetFillColor.md)"; $pdf ; 0; 0; 0) \]   
\# and write centered text   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.SetFont](DynaPDFSetFont.md)"; $pdf ; "Helvetica"; 0; 20) \]   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.WriteFTextEx](DynaPDFWriteFTextEx.md)"; $pdf ; 50; $pageHeight - 50; $pageWidth -100; 30; "center"; GetAsText($PageNumber ) &amp; " of " &amp; $PageCount ) \]  
### See also

- [DynaPDF.ClipPath](DynaPDFClipPath.md)
- [DynaPDF.ClosePath](DynaPDFClosePath.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.RoundRect](DynaPDFRoundRect.md)
- [DynaPDF.SetDrawDirection](DynaPDFSetDrawDirection.md)
- [DynaPDF.SetFillColor](DynaPDFSetFillColor.md)
- [DynaPDF.SetFont](DynaPDFSetFont.md)
- [DynaPDF.SetLineWidth](DynaPDFSetLineWidth.md)
- [DynaPDF.WriteFText](DynaPDFWriteFText.md)
- [DynaPDF.WriteFTextEx](DynaPDFWriteFTextEx.md)

### Example Databases

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

### Blog Entries

- [Draw images with text using DynaPDF](https://www.mbsplugins.de/archive/2026-01-03/Draw_images_with_text_using_Dy/monkeybreadsoftware_blog_filemaker)
- [Page Layouting in DynaPDF](https://www.mbsplugins.de/archive/2024-04-05/Page_Layouting_in_DynaPDF/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.2pr4](https://www.mbsplugins.de/archive/2013-03-18/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 13th December 2023

  
[DynaPDF.RoundRect](DynaPDFRoundRect.md) - [DynaPDF.Save](DynaPDFSave.md)

[HTML Version](DynaPDFRoundRectEx.shtml)