DynaPDF.WebLink
---------------

Inserts a web link onto the current open page.

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

MBS( "DynaPDF.WebLink"; PDF; PosX; PosY; Width; Height; URL ) 

**MBS**( **"DynaPDF.WebLink";** /\* Inserts a web link onto 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 \*/   
**$URL**) /\* URL defined as null-terminated 7 bit ASCII string.e.g. "http://www.mbsplugins.de" \*/ 

### 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 |
| URL | URL defined as null-terminated 7 bit ASCII string. | "http://www.mbsplugins.de" |

### Result

Returns new handle or error.

### Description

Inserts a web link onto the current open page.  
The parameter URL holds the URL defined as 7 bit ASCII string. A uniform resource locator (URL) is a string that resolves to a resource on the internet - typically a file that is the destination of a hypertext link, although it can also resolve to a query or other entity. A web link opens the standard browser to view the resource by default. The full version of Adobes Acrobat enables you also to embed a reverenced html resource in your document.  
  
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.  
  
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.  
  
Please use [DynaPDF.WriteText](DynaPDFWriteText.md) if you first want to add text to the page before you make it a clickable link.  
  
Use DynaPDF.WebLink for web links, [DynaPDF.FileLink](DynaPDFFileLink.md) 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 [WebLink](https://www.monkeybreadsoftware.com/DynaPDF-Manual/WebLink.shtml) function in DynaPDF manual.

### Examples

Add a link to MBS Blog:

 MBS ( "DynaPDF.WebLink"; $PDF ; 100; 100; 100; 20; "https://www.mbsplugins.de/filemaker" )  
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"; $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](DynaPDFPageLink.md)"; $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 )\]  
Setup drawing for links:

 Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetLineWidth](DynaPDFSetLineWidth.md)"; $pdf ; 1) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetLinkHighlightMode](DynaPDFSetLinkHighlightMode.md)"; $pdf ; "invert") \]  
Add a link to an area of a PDF:

 Set Variable \[ $pdf ; Value: MBS ("[DynaPDF.New](DynaPDFNew.md)") \]   
\# Set some flags for import   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetImportFlags](DynaPDFSetImportFlags.md)"; $pdf ; "ImportAll ImportAsPage") \]   
\#   
\# Add first page   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.OpenPDFFromContainer](DynaPDFOpenPDFFromContainer.md)"; $pdf ; PDF::Input PDF) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.ImportPDFFile](DynaPDFImportPDFFile.md)"; $pdf ; 1) \]   
\#   
\# setup drawing for links   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetLineWidth](DynaPDFSetLineWidth.md)"; $pdf ; 1) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetLinkHighlightMode](DynaPDFSetLinkHighlightMode.md)"; $pdf ; "invert") \]   
\#   
\# edit page   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.EditPage](DynaPDFEditPage.md)"; $pdf ; 1) \]   
\# now add a link to an area there   
Set Variable \[ $r ; Value: MBS ( "DynaPDF.WebLink"; $pdf ; 100; 100; 200; 200; "https://www.monkeybreadsoftware.com/filemaker/" ) \]   
\#   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.EndPage](DynaPDFEndPage.md)"; $pdf ) \]   
\#   
Go to Layout \[ “PDF” (PDF) ; Animation: None \]  
\# save PDF   
Set Variable \[ $PDFData ; Value: MBS ("[DynaPDF.Save](DynaPDFSave.md)"; $pdf ; GetAsText(PDF::Input PDF)) \]   
\#   
\# Free all data   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.Release](DynaPDFRelease.md)"; $pdf ) \]   
\#   
\# Put in Container   
Set Field \[ PDF::Output PDF ; $PDFData \]  
### See also

- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.PageLink](DynaPDFPageLink.md)
- [DynaPDF.PageLinkEx](DynaPDFPageLinkEx.md)
- [DynaPDF.Release](DynaPDFRelease.md)
- [DynaPDF.Save](DynaPDFSave.md)
- [DynaPDF.SetFont](DynaPDFSetFont.md)
- [DynaPDF.SetImportFlags](DynaPDFSetImportFlags.md)
- [DynaPDF.SetLinkHighlightMode](DynaPDFSetLinkHighlightMode.md)
- [DynaPDF.WriteFText](DynaPDFWriteFText.md)
- [DynaPDF.WriteFTextEx](DynaPDFWriteFTextEx.md)

### Example Databases

- [DynaPDF/Add Weblinks](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Add%20Weblinks.shtml#3ScriptAnchor_)

### Blog Entries

- [MBS @ FMTraining.TV - FileMaker MonkeyBread Plug-in Q&amp;A](https://www.mbsplugins.de/archive/2025-10-11/MBS_@_FMTrainingTV_-_FileMaker/monkeybreadsoftware_blog_filemaker)
- [Page Layouting in DynaPDF](https://www.mbsplugins.de/archive/2024-04-05/Page_Layouting_in_DynaPDF/monkeybreadsoftware_blog_filemaker)
- [Combined Components with MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2021-03-29/Combined_Components_with_MBS_F/monkeybreadsoftware_blog_filemaker)
- [Example Script for DynaPDF.FindText and DynaPDF.WebLink](https://www.mbsplugins.de/archive/2020-05-04/Example_Script_for_DynaPDFFind/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.0pr5](https://www.mbsplugins.de/archive/2014-01-27/MBS_Filemaker_Plugin_version_4/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 August 2014 , last changed 30th January 2024

  
[DynaPDF.WatermarkAnnot](DynaPDFWatermarkAnnot.md) - [DynaPDF.WriteDemoText](DynaPDFWriteDemoText.md)

[HTML Version](DynaPDFWebLink.shtml)