DynaPDF.Bezier123
-----------------

Draws a bezier path.

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

MBS( "DynaPDF.Bezier123"; PDF; x1; y1; x2; y2; x3; y3 ) 

**MBS**( **"DynaPDF.Bezier123";** /\* Draws a bezier path. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$x1**; /\* X-Coordinate of the first control point P1 \*/   
**$y1**; /\* Y-Coordinate of the first control point P1 \*/   
**$x2**; /\* X-Coordinate of the second control point P2 \*/   
**$y2**; /\* Y-Coordinate of the second control point P2 \*/   
**$x3**; /\* X-Coordinate of the end point P3 \*/   
**$y3**) /\* Y-Coordinate of the end point P3 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| x1 | X-Coordinate of the first control point P1 | $x1 |
| y1 | Y-Coordinate of the first control point P1 | $y1 |
| x2 | X-Coordinate of the second control point P2 | $x2 |
| y2 | Y-Coordinate of the second control point P2 | $y2 |
| x3 | X-Coordinate of the end point P3 | $x3 |
| y3 | Y-Coordinate of the end point P3 | $y3 |

### Result

Returns OK or error.

### Description

Draws a bezier path.  
Curved path segments are specified as cubic Bézier curves. Such curves are defined by four points: the two endpoints (the current point P0 and the final point P3) and two control points P1 and P2. Given the coordinates of the four points, the curve is generated by varying the parameter t from 0.0 to 1.0 in the following equation:  
R(t)=(1-t)3P0 +3t(1-t)2P1+3t2(1-t)P2 +t3P3  
When t = 0.0, the value of the function R(t) coincides with the current point P0; when t = 1.0, R(t) coincides with the final point P3. Intermediate values of t generate intermediate points along the curve. The curve does not, in general, pass through the two control points P1 and P2. Cubic Bézier curves have two desirable properties:  
- The curve can be very quickly split into smaller pieces for rapid rendering.
- The curve is contained within the convex hull of the four points defining the curve, most easily visualized as the polygon obtained by stretching a rubber band around the outside of the four points. This property allows rapid testing of whether the curve lies completely outside the visible region, and hence does not have to be rendered.

The most general type of curve in PDF is the cubic Bézier curve with two control points. The starting point P0 is the current point that was set before by a painting operator ([DynaPDF.MoveTo](DynaPDFMoveTo.md), [DynaPDF.LineTo](DynaPDFLineTo.md) and so on). PDF also supports two other Bézier curves with only one control point (see [DynaPDF.Bezier13](DynaPDFBezier13.md) and [DynaPDF.Bezier23](DynaPDFBezier23.md)). Theses two curve types are rarely used but still supported by all Acrobat versions incl. DynaPDF.  
As mentioned earlier the function requires a start point that must be set with [DynaPDF.MoveTo](DynaPDFMoveTo.md) or another painting operator beforehand. Once the start point was set, multiple curve segments can be drawn to build circles, ellipses or other curved paths. The [DynaPDF](component_DynaPDF.md) functions [DynaPDF.DrawArc](DynaPDFDrawArc.md), [DynaPDF.DrawCircle](DynaPDFDrawCircle.md), [DynaPDF.Ellipse](DynaPDFEllipse.md) and so on use all DynaPDF.Bezier123 to construct the path.  
See also [Bezier123](https://www.monkeybreadsoftware.com/DynaPDF-Manual/Bezier_1_2_3.shtml) function in DynaPDF manual.

### See also

- [DynaPDF.Bezier13](DynaPDFBezier13.md)
- [DynaPDF.Bezier23](DynaPDFBezier23.md)
- [DynaPDF.DrawArc](DynaPDFDrawArc.md)
- [DynaPDF.DrawCircle](DynaPDFDrawCircle.md)
- [DynaPDF.Ellipse](DynaPDFEllipse.md)
- [DynaPDF.LineTo](DynaPDFLineTo.md)
- [DynaPDF.MoveTo](DynaPDFMoveTo.md)
- [DynaPDF.New](DynaPDFNew.md)

### Example Databases

- [DynaPDF/Create PDF with Bezier Curves](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Create%20PDF%20with%20Bezier%20Curves.shtml#11ScriptAnchor_)

### Blog Entries

- [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 18th August 2014

  
[DynaPDF.BeginTemplate](DynaPDFBeginTemplate.md) - [DynaPDF.Bezier13](DynaPDFBezier13.md)

[HTML Version](DynaPDFBezier123.shtml)