DynaPDF.FileLink
----------------

Creates a file link annotation.

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

MBS( "DynaPDF.FileLink"; PDF; PosX; PosY; Width; Height; FilePath ) 

**MBS**( **"DynaPDF.FileLink";** /\* Creates a file link annotation. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$PosX**; /\* X-Coordinate of bounding rectanglee.g. 100 \*/   
**$PosY**; /\* Y-Coordinate of bounding rectanglee.g. 100 \*/   
**$Width**; /\* Width of bounding rectanglee.g. 100 \*/   
**$Height**; /\* Height of bounding rectanglee.g. 20 \*/   
**$FilePath**) /\* The file path to use.e.g. "C:\\test.pdf" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| PosX | X-Coordinate of bounding rectangle | 100 |
| PosY | Y-Coordinate of bounding rectangle | 100 |
| Width | Width of bounding rectangle | 100 |
| Height | Height of bounding rectangle | 20 |
| FilePath | The file path to use. | "C:\\test.pdf" |

### Result

Returns number or error.

### Description

Creates a file link annotation.   
A file link annotation opens a file by using the application that is connected with the file extension (MIME type). Viewer applications maybe display a warning before the file is opened.   
  
The file path can be defined as relative or absolute path. However, the usage of an absolute makes only sense if it can be guaranteed that the path exist on an arbitrary system.   
  
If the coordinate system is bottom-up the point PosX, PosY defines the lower left corner of the bounding rectangle. If the coordinate system is top-down it defines the upper left corner.   
  
The border of the link annotation is drawn by using the current line width, stroke color and line dash pattern. If the link should appear without a border set the line width to zero beforehand (with [DynaPDF.SetLineWidth](DynaPDFSetLineWidth.md)).   
  
When clicking on a link annotation the rectangle is highlighted, that is a simple visual effect. Several highlight modes are supported, see [DynaPDF.SetLinkHighlightMode](DynaPDFSetLinkHighlightMode.md) for further information.   
The function does not check whether the path is valid.   
  
If the function succeeds the return value is an annotation handle, a value greater or equal zero. If the function fails it returns an error.   
  
Use [DynaPDF.WebLink](DynaPDFWebLink.md) for web links, DynaPDF.FileLink for file links, [DynaPDF.PageLink](DynaPDFPageLink.md) or [DynaPDF.PageLinkEx](DynaPDFPageLinkEx.md) for page links and [DynaPDF.FindText](DynaPDFFindText.md) can help to find the location where to place the link.  
See also [FileLink](https://www.monkeybreadsoftware.com/DynaPDF-Manual/FileLink.shtml) function in DynaPDF manual.

### See also

- [DynaPDF.FindText](DynaPDFFindText.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.OpenTag](DynaPDFOpenTag.md)
- [DynaPDF.PageLink](DynaPDFPageLink.md)
- [DynaPDF.PageLinkEx](DynaPDFPageLinkEx.md)
- [DynaPDF.SetLineWidth](DynaPDFSetLineWidth.md)
- [DynaPDF.SetLinkHighlightMode](DynaPDFSetLinkHighlightMode.md)
- [DynaPDF.WebLink](DynaPDFWebLink.md)

### Release notes

- **Version 7.2**
    - Added [DynaPDF.FileLink](http://www.mbsplugins.eu/DynaPDFFileLink.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin, version 7.2pr5](https://www.mbsplugins.de/archive/2017-05-08/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 29th April 2017 , last changed 9th December 2019

  
[DynaPDF.FileAttachAnnotEx](DynaPDFFileAttachAnnotEx.md) - [DynaPDF.FindBookmark](DynaPDFFindBookmark.md)

[HTML Version](DynaPDFFileLink.shtml)