DynaPDF.LineTo
--------------

The function draws a path from the current position up to the specified point.

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

MBS( "DynaPDF.LineTo"; PDF; PosX; PosY ) 

**MBS**( **"DynaPDF.LineTo";** /\* The function draws a path from the current position up to the specified point. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$PosX**; /\* The x-coordinate.e.g. $x \*/   
**$PosY**) /\* The y-coordinate.e.g. $y \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| PosX | The x-coordinate. | $x |
| PosY | The y-coordinate. | $y |

### Result

Returns OK or error.

### Description

The function draws a path from the current position up to the specified point.   
The start point must be set with another vector graphic function beforehand, such as [DynaPDF.MoveTo](DynaPDFMoveTo.md) or other functions which draw an open path segment.  
In PDF all vector graphics are defined as paths, a path is invisible as long it was not stroked, filled or both. See also Path construction and Painting.  
See also [LineTo](https://www.monkeybreadsoftware.com/DynaPDF-Manual/LineTo.shtml) function in DynaPDF manual.

### Examples

Draw two lines in black:

 Set Variable \[$r ; Value:MBS ( "[DynaPDF.SetStrokeColor](DynaPDFSetStrokeColor.md)" ; $pdf ; 0; 0; 0 )\]  
Set Variable \[$r ; Value:MBS ( "[DynaPDF.SetLineWidth](DynaPDFSetLineWidth.md)" ; $pdf ; 1 )\]  
Set Variable \[$r ; Value:MBS ( "[DynaPDF.MoveTo](DynaPDFMoveTo.md)" ; $pdf ; 20; 20)\]  
Set Variable \[$r ; Value:MBS ( "DynaPDF.LineTo" ; $pdf ; 20; 40)\]  
Set Variable \[$r ; Value:MBS ( "[DynaPDF.MoveTo](DynaPDFMoveTo.md)" ; $pdf ; 30; 30)\]  
Set Variable \[$r ; Value:MBS ( "DynaPDF.LineTo" ; $pdf ; 30; 50)\]  
Set Variable \[$r ; Value:MBS ( "[DynaPDF.StrokePath](DynaPDFStrokePath.md)" ; $pdf )\]  
Draw triangle path:

 # blue color   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetFillColor](DynaPDFSetFillColor.md)"; $pdf ; 0; 0; 1) \]   
\# go to start point   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.MoveTo](DynaPDFMoveTo.md)"; $pdf ; 100; 100) \]   
\# add more points   
Set Variable \[ $r ; Value: MBS ("DynaPDF.LineTo"; $pdf ; 200; 100) \]   
Set Variable \[ $r ; Value: MBS ("DynaPDF.LineTo"; $pdf ; 100; 200) \]   
\# and fill   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.ClosePath](DynaPDFClosePath.md)"; $pdf ; "fill") \]  
### See also

- [DynaPDF.Bezier123](DynaPDFBezier123.md)
- [DynaPDF.ClipPath](DynaPDFClipPath.md)
- [DynaPDF.ClosePath](DynaPDFClosePath.md)
- [DynaPDF.LineAnnot](DynaPDFLineAnnot.md)
- [DynaPDF.MoveTo](DynaPDFMoveTo.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.SetFillColor](DynaPDFSetFillColor.md)
- [DynaPDF.SetLineWidth](DynaPDFSetLineWidth.md)
- [DynaPDF.SetStrokeColor](DynaPDFSetStrokeColor.md)
- [DynaPDF.StrokePath](DynaPDFStrokePath.md)

### Example Databases

- [DynaPDF/Book Creation](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Book%20Creation.shtml#4ScriptAnchor_)
- [DynaPDF/Convert to 2 Pages](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Convert%20to%202%20Pages.shtml#4ScriptAnchor_)

### 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)
- [Adding cutting lines for PDF in FileMaker](https://www.mbsplugins.de/archive/2021-01-04/Adding_cutting_lines_for_PDF_i/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)

### 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 7th March 2020

  
[DynaPDF.LineAnnot](DynaPDFLineAnnot.md) - [DynaPDF.List](DynaPDFList.md)

[HTML Version](DynaPDFLineTo.shtml)