DynaPDF.HighlightAnnot
----------------------

Creates a Highlight annotation.

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

MBS( "DynaPDF.HighlightAnnot"; PDF; SubType; PosX; PosY; Width; Height; HighlightColor; Author; Subject; Comment ) 

**MBS**( **"DynaPDF.HighlightAnnot";** /\* Creates a Highlight annotation. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$SubType**; /\* The subtype of annotation.  
Allowed values are Highlight, Squiggly, StrikeOut, or Underline.e.g. "Highlight" \*/   
**$PosX**; /\* X-coordinate of the annotatione.g. 100 \*/   
**$PosY**; /\* Y-coordinate of the annotatione.g. 100 \*/   
**$Width**; /\* Width of the annotatione.g. 100 \*/   
**$Height**; /\* Height of the annotatione.g. 100 \*/   
**$HighlightColor**; /\* Highlight color.e.g. 200 \*/   
**$Author**; /\* The author name. Can be empty.e.g. "Christian Schmitz" \*/   
**$Subject**; /\* The subject to use. Can be empty. \*/   
**$Comment**) /\* The comment. Can be empty. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| SubType | The subtype of annotation.   Allowed values are Highlight, Squiggly, StrikeOut, or Underline. | "Highlight" |
| PosX | X-coordinate of the annotation | 100 |
| PosY | Y-coordinate of the annotation | 100 |
| Width | Width of the annotation | 100 |
| Height | Height of the annotation | 100 |
| HighlightColor | Highlight color. | 200 |
| Author | The author name. Can be empty. | "Christian Schmitz" |
| Subject | The subject to use. Can be empty. |  |
| Comment | The comment. Can be empty. |  |

### Result

Returns annotation handle or error.

### Description

Creates a Highlight annotation.   
Highlight annotations are used to mark text on a PDF 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 parameter Color specifies the highlight color; it must be defined in RGB color space. The line width of a Strikout or Underline annotation is not adjustable. The line width depends on the size of the annotation and is automatically calculated.  
The active color space must be set to DeviceRGB before creating the annotation. See [DynaPDF.SetColorSpace](DynaPDFSetColorSpace.md) for further information.  
See also [HighlightAnnot](https://www.monkeybreadsoftware.com/DynaPDF-Manual/HighlightAnnot.shtml) function in DynaPDF manual.

### Examples

Add a highlight annotation to page 3:

 Set Variable \[ $r ; Value: MBS ("[DynaPDF.EditPage](DynaPDFEditPage.md)"; $pdf ; 3) \]   
Set Variable \[ $r ; Value: MBS ( "DynaPDF.HighlightAnnot"; $pdf ; "Highlight"; 100; 100; 300; 200; MBS ( "[DynaPDF.RGB](DynaPDFRGB.md)"; 200; 100; 100 )) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.EndPage](DynaPDFEndPage.md)"; $pdf ) \]  
### See also

- [DynaPDF.EditPage](DynaPDFEditPage.md)
- [DynaPDF.EndPage](DynaPDFEndPage.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.RGB](DynaPDFRGB.md)
- [DynaPDF.SetColorSpace](DynaPDFSetColorSpace.md)

### 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)

This function checks for a license.

Created 28th November 2014 , last changed 21st August 2021

  
[DynaPDF.HavePro](DynaPDFHavePro.md) - [DynaPDF.HighlightPattern](DynaPDFHighlightPattern.md)

[HTML Version](DynaPDFHighlightAnnot.shtml)