DynaPDF.FileAttachAnnot
-----------------------

Inserts a file attachment annotation on the current open page.

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

MBS( "DynaPDF.FileAttachAnnot"; PDF; PosX; PosY; Icon; Author; Description; FilePath; Compress ) 

**MBS**( **"DynaPDF.FileAttachAnnot";** /\* Inserts a file attachment annotation on the current open page. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$PosX**; /\* X-Coordinate for the annotation icone.g. 100 \*/   
**$PosY**; /\* Y-Coordinate for the annotation icone.g. 100 \*/   
**$Icon**; /\* Which icon to use. Can be Graph, PaperClip, PushPin or Tag.e.g. "Graph" \*/   
**$Author**; /\* Name of author. Can be empty.e.g. "Christian Schmitz" \*/   
**$Description**; /\* Description text. Can be empty.e.g. "Original File" \*/   
**$FilePath**; /\* The native file path to the file to embed.e.g. "/Users/cs/Desktop/test.mp3" \*/   
**$Compress**) /\* If 1, the embedded file is compressed. Pass 0 for no compression.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| PosX | X-Coordinate for the annotation icon | 100 |
| PosY | Y-Coordinate for the annotation icon | 100 |
| Icon | Which icon to use. Can be Graph, PaperClip, PushPin or Tag. | "Graph" |
| Author | Name of author. Can be empty. | "Christian Schmitz" |
| Description | Description text. Can be empty. | "Original File" |
| FilePath | The native file path to the file to embed. | "/Users/cs/Desktop/test.mp3" |
| Compress | If 1, the embedded file is compressed. Pass 0 for no compression. | 0 |

### Result

Returns annotation handle or error.

### Description

Inserts a file attachment annotation on the current open page.   
If the coordinate system is bottom-up the point PosX, PosY defines the lower left point of the annotation icon. If the coordinate system is top-down it defines the upper left point. The width and height of the icon is not changeable.  
The embedded file is compressed if the parameter Compress is set to 1. Otherwise it is left uncompressed. It is not always useful to compress embedded files especially if the file is already compressed, e.g. Zip files or already compressed image formats require no further compression. In the worst case the compressed files becomes larger. However, text files and most document formats should be compressed to reduce the file size.  
   
File attachment annotations are supported since PDF 1.3 (Acrobat 4). File attachments are supported since PDF 1.4 (Acrobat 5). The difference between both attachment types is that a file attachment annotation is used as a comment that has usually a visible icon on a page, e.g. to provide additional information about a specific object.  
File attachments are used to add arbitrary files to the PDF file, e.g. job options, the original document from which the file was created, or any other file (see also [DynaPDF.AttachFile](DynaPDFAttachFile.md)).  
Note that Acrobat 7 or higher restricts access to executable files and compressed file formats such as zip, or rar. If such files must be embedded then change the file extension, e.g. to .dat or .bin. The user must then change the extension again when extracting the file.  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
See also [FileAttachAnnot](https://www.monkeybreadsoftware.com/DynaPDF-Manual/FileAttachAnnot.shtml) function in DynaPDF manual.

### See also

- [DynaPDF.AttachFile](DynaPDFAttachFile.md)
- [DynaPDF.CreateGoToEAction](DynaPDFCreateGoToEAction.md)
- [DynaPDF.FileAttachAnnotEx](DynaPDFFileAttachAnnotEx.md)
- [DynaPDF.New](DynaPDFNew.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)

### Release notes

- **Version 8.0**
    - Added [DynaPDF.RenderPDFFileEx](http://www.mbsplugins.eu/DynaPDFRenderPDFFileEx.shtml), [DynaPDF.FileAttachAnnotEx](http://www.mbsplugins.eu/DynaPDFFileAttachAnnotEx.shtml) and [DynaPDF.ExtractText](http://www.mbsplugins.eu/DynaPDFExtractText.shtml).

### Blog Entries

- [Unlocking the Power of PDFs in FileMaker with DynaPDF and the MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2024-09-16/Unlocking_the_Power_of_PDFs_in/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 14.1](https://www.mbsplugins.de/archive/2024-03-19/New_in_MBS_FileMaker_Plugin_14/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 28th November 2014 , last changed 30th November 2014

  
[DynaPDF.ExtractText](DynaPDFExtractText.md) - [DynaPDF.FileAttachAnnotEx](DynaPDFFileAttachAnnotEx.md)

[HTML Version](DynaPDFFileAttachAnnot.shtml)