DynaPDF.PageLink
----------------

Adds a page link to the current open page.

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

MBS( "DynaPDF.PageLink"; PDF; PosX; PosY; Width; Height; DestPage ) 

**MBS**( **"DynaPDF.PageLink";** /\* Adds a page link to the current open page. \*/  
**$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 \*/   
**$DestPage**) /\* The destination page number.e.g. 5 \*/ 

### 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 |
| DestPage | The destination page number. | 5 |

### Result

Returns number or error.

### Description

Adds a page link to the current open page.   
The parameter DestPage specifies the destination page which should be opened (the page number). The function does not check whether the destination page exists; it can be created later. If the destination page does not exist when the document is closed it will be set to the first page.   
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 destination page is always opened at the top corner. More precise destinations can be created with the function [DynaPDF.PageLinkEx](DynaPDFPageLinkEx.md). Page links can also be used to execute an action. The destination page is ignored in the latter case, the annotation works then like a button.   
If the function succeeds the return value is the annotation handle, a value greater or equal zero. If the function fails the return value is an error message.   
  
Use [DynaPDF.WebLink](DynaPDFWebLink.md) for web links, [DynaPDF.FileLink](DynaPDFFileLink.md) for file links, DynaPDF.PageLink 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 [PageLink](https://www.monkeybreadsoftware.com/DynaPDF-Manual/PageLink.shtml) function in DynaPDF manual.

### Examples

Add various links to a page:

 # import page   
Set Variable \[$r ; Value:MBS ("[DynaPDF.OpenPDFFromContainer](DynaPDFOpenPDFFromContainer.md)"; $pdf ; Add Page Numbers::Input )\]  
Set Variable \[$r ; Value:MBS ("[DynaPDF.ImportPDFFile](DynaPDFImportPDFFile.md)"; $pdf ; 1)\]  
  
\# edit first page   
Set Variable \[$r ; Value:MBS ("[DynaPDF.EditPage](DynaPDFEditPage.md)"; $pdf ; 1)\]  
Set Variable \[$r ; Value:MBS ( "[DynaPDF.SetFont](DynaPDFSetFont.md)"; $pdf ; "Helvetica"; 0; 20)\]  
\#Add web link   
Set Variable \[$r ; Value:MBS ( "[DynaPDF.WriteFTextEx](DynaPDFWriteFTextEx.md)"; $PDF ; 100; 100; 150; 20; "left"; "Go to MBS Blog" )\]  
Set Variable \[$r ; Value:MBS ( "[DynaPDF.WebLink](DynaPDFWebLink.md)"; $PDF ; 100; 80; 150; 20; "https://www.mbsplugins.de/filemaker" )\]  
\#Add page link   
Set Variable \[$r ; Value:MBS ( "[DynaPDF.WriteFTextEx](DynaPDFWriteFTextEx.md)"; $PDF ; 100; 150; 150; 20; "left"; "Jump to page 3" )\]  
Set Variable \[$r ; Value:MBS ( "DynaPDF.PageLink"; $PDF ; 100; 130; 150; 20; 3)\]  
\#Add page link with more options   
Set Variable \[$r ; Value:MBS ( "[DynaPDF.WriteFTextEx](DynaPDFWriteFTextEx.md)"; $PDF ; 100; 200; 200; 20; "left"; "Jump to Letter D Zoomed" )\]  
Set Variable \[$r ; Value:MBS ( "[DynaPDF.PageLinkEx](DynaPDFPageLinkEx.md)"; $PDF ; 100; 180; 200; 20; "FitRect"; 4; 60; 590; 135; 160)\]  
\# Close page   
Set Variable \[$r ; Value:MBS ("[DynaPDF.EndPage](DynaPDFEndPage.md)"; $pdf )\]  
### See also

- [DynaPDF.EndPage](DynaPDFEndPage.md)
- [DynaPDF.FileLink](DynaPDFFileLink.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.OpenPDFFromContainer](DynaPDFOpenPDFFromContainer.md)
- [DynaPDF.OpenTag](DynaPDFOpenTag.md)
- [DynaPDF.SetFont](DynaPDFSetFont.md)
- [DynaPDF.SetLineWidth](DynaPDFSetLineWidth.md)
- [DynaPDF.SetLinkHighlightMode](DynaPDFSetLinkHighlightMode.md)
- [DynaPDF.WriteFText](DynaPDFWriteFText.md)
- [DynaPDF.WriteFTextEx](DynaPDFWriteFTextEx.md)

### Release notes

- **Version 7.0**
    - Added [DynaPDF.PageLink](http://www.mbsplugins.eu/DynaPDFPageLink.shtml) and [DynaPDF.PageLinkEx](http://www.mbsplugins.eu/DynaPDFPageLinkEx.shtml) functions.

### Example Databases

- [DynaPDF/Add Page Links](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Add%20Page%20Links.shtml#2ScriptAnchor_)
- [DynaPDF/Add Weblinks](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Add%20Weblinks.shtml#3ScriptAnchor_)
- [DynaPDF/Picture to PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Picture%20to%20PDF.shtml#7ScriptAnchor_)

### Blog Entries

- [Add page links for FileMaker](https://www.mbsplugins.de/archive/2022-06-18/Add_page_links_for_FileMaker/monkeybreadsoftware_blog_filemaker)
- [Things you can do with DynaPDF](https://www.mbsplugins.de/archive/2021-07-02/Things_you_can_do_with_DynaPDF/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.0pr1](https://www.mbsplugins.de/archive/2017-01-02/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 3/2019, Seite 38](https://filemaker-magazin.de/neuigkeit/4046-Appetithappen-FMM_201903)

This function checks for a license.

Created 18th December 2016 , last changed 25th January 2024

  
[DynaPDF.Optimize](DynaPDFOptimize.md) - [DynaPDF.PageLinkEx](DynaPDFPageLinkEx.md)

[HTML Version](DynaPDFPageLink.shtml)