DynaPDF.CreateGoToEAction
-------------------------

Creates an embedded GoTo action.

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

MBS( "DynaPDF.CreateGoToEAction"; Location; Source; SrcPage; Target; DestName; DestPage; NewWindow ) 

**MBS**( **"DynaPDF.CreateGoToEAction";** /\* Creates an embedded GoTo action. \*/  
**$Location**; /\* Specifies where the embedded file can be found.e.g. "Child" \*/   
**$Source**; /\* Required for external files. \*/   
**$SrcPage**; /\* Source page, if the file is located in an annotation. \*/   
**$Target**; /\* The target file that should be opened. \*/   
**$DestName**; /\* A named destination to be opened. \*/   
**$DestPage**; /\* Only used if DestName is empty. \*/   
**$NewWindow**) /\* Open the file in a new window?e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Location | Specifies where the embedded file can be found. | "Child" |
| Source | Required for external files. |  |
| SrcPage | Source page, if the file is located in an annotation. |  |
| Target | The target file that should be opened. |  |
| DestName | A named destination to be opened. |  |
| DestPage | Only used if DestName is empty. |  |
| NewWindow | Open the file in a new window? | 0 |

### Result

Returns number or error.

### Description

Creates an embedded GoTo action.  
This action type opens an embedded PDF file that is located in the current, parent, or in an external PDF file.   
Embedded files can be attached directly, e.g. with [DynaPDF.AttachFile](DynaPDFAttachFile.md), or embedded in file attachment annotations with [DynaPDF.FileAttachAnnot](DynaPDFFileAttachAnnot.md).   
The parameter Location specifies where the embedded file can be found. File attachment annotations are stored in pages and not globally like ordinary file attachments. Therefore, the source page in which the annotation can be found must be known if the target file is stored in a file attachment annotation (parameter SrcPage). The first page number is denoted by 1.   
The parameter Source specifies the source file if the embedded file is located in an external PDF file. This parameter is only used if Location is set to "External" or "ExternalAnnot". It can be set to "" in all other cases.   
The parameter Target is required; it specifies either the name of the embedded PDF file or the name of the annotation in which the file is stored. The name of a file attachment annotation must be set with [DynaPDF.SetAnnotString](DynaPDFSetAnnotString.md). The names of all annotations in a page must be unique. The function does not check whether the annotation or embedded file exists. Therefore, the target file can be embedded before or after the action was created.   
The name of an embedded file is the file name if it was attached with [DynaPDF.AttachFile](DynaPDFAttachFile.md) or [DynaPDF.AttachFileContainer](DynaPDFAttachFileContainer.md). The function extracts the file name automatically if a path was passed to the function.   
It is not allowed to use different string formats in [DynaPDF.AttachFile](DynaPDFAttachFile.md) or [DynaPDF.SetAnnotString](DynaPDFSetAnnotString.md) and in the corresponding CreateGoToEAction call. The same restriction applies to named destinations.   
The destination page that should be opened can be either specified directly with the parameter DestPage or with a Named Destination (see [DynaPDF.CreateNamedDest](DynaPDFCreateNamedDest.md) for further information). Named destinations take precedence.   
A path to an external PDF file should be defined as relative path. Actions must be added to a PDF object with [DynaPDF.AddActionToObj](DynaPDFAddActionToObj.md).   
  
| Child | The file is embedded in the current file |
|---|---|
| ChildAnnot | The file is embedded in a file attachment annotation |
| External | The file is an embedded file in an external file |
| ExternalAnnot | The file is embedded in a file attachment annotation |
| Parent | The file is located in the parent document |
| ParentAnnot | The file is located in a file attachment annotation |

See also [CreateGoToEAction](https://www.monkeybreadsoftware.com/DynaPDF-Manual/CreateGoToEAction.shtml) function in DynaPDF manual.

### Examples

Create a button to open first embedded PDF file:

 # we can add a button to open first attachment   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.EditPage](DynaPDFEditPage.md)"; $PDF ; 1) \]   
Set Variable \[ $FirstFilename ; Value: MBS ( "[DynaPDF.GetEmbeddedFile](DynaPDFGetEmbeddedFile.md)"; $PDF ; 0; "name") \]   
\# we create an action to open an embedded file by name   
Set Variable \[ $Action ; Value: MBS ( "DynaPDF.CreateGoToEAction"; $pdf ; "Child"; ""; 0; $FirstFilename ; ""; 1; 1 ) \]   
\# we create a button to open that embedded file   
Set Variable \[ $button ; Value: MBS ( "[DynaPDF.CreateButton](DynaPDFCreateButton.md)"; $pdf ; "OpenAttachment"; "Open First Attachment"; -1; 100; 100; 100; 20 ) \]   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.AddActionToObj](DynaPDFAddActionToObj.md)"; $pdf ; "Field"; "OnMouseUp"; $Action ; $Button ) \]   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.EndPage](DynaPDFEndPage.md)"; $PDF ) \]  
### See also

- [DynaPDF.CreateButton](DynaPDFCreateButton.md)
- [DynaPDF.CreateGoToActionEx](DynaPDFCreateGoToActionEx.md)
- [DynaPDF.CreateGoToRAction](DynaPDFCreateGoToRAction.md)
- [DynaPDF.CreateGoToRActionEx](DynaPDFCreateGoToRActionEx.md)
- [DynaPDF.CreateURIAction](DynaPDFCreateURIAction.md)
- [DynaPDF.EditPage](DynaPDFEditPage.md)
- [DynaPDF.EndPage](DynaPDFEndPage.md)
- [DynaPDF.FileAttachAnnot](DynaPDFFileAttachAnnot.md)
- [DynaPDF.GetEmbeddedFile](DynaPDFGetEmbeddedFile.md)
- [DynaPDF.SetAnnotString](DynaPDFSetAnnotString.md)

### Release notes

- **Version 14.1**
    - Added [DynaPDF.CreateGoToEAction](https://www.mbsplugins.eu/DynaPDFCreateGoToEAction.shtml) function.

### Example Databases

- [DynaPDF/PDF Attachments](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/PDF%20Attachments.shtml#6ScriptAnchor_)

### Blog Entries

- [New in MBS FileMaker Plugin 14.1](https://www.mbsplugins.de/archive/2024-03-19/New_in_MBS_FileMaker_Plugin_14/monkeybreadsoftware_blog_filemaker)
- [Neues MBS Plugin 14.1 für Claris FileMaker](https://www.mbsplugins.de/archive/2024-03-12/Neues_MBS_Plugin_141_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 14.1 for Claris FileMaker](https://www.mbsplugins.de/archive/2024-03-12/MBS_Plugin_141_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 14.1pr1](https://www.mbsplugins.de/archive/2024-02-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [PDF Attachments in FileMaker with DynaPDF](https://www.mbsplugins.de/archive/2024-01-29/PDF_Attachments_in_FileMaker_w/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 17th January 2024 , last changed 22nd January 2024

  
[DynaPDF.CreateGoToActionEx](DynaPDFCreateGoToActionEx.md) - [DynaPDF.CreateGoToRAction](DynaPDFCreateGoToRAction.md)

[HTML Version](DynaPDFCreateGoToEAction.shtml)