DynaPDF.HighlightPattern
------------------------

Searches a text and adds highlights for it.

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

MBS( "DynaPDF.HighlightPattern"; PDF; Text { ; HighlightColor; CaseInsensitive } ) 

**MBS**( **"DynaPDF.HighlightPattern";** /\* Searches a text and adds highlights for it. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Text**; /\* The text to search.e.g. "Hello" \*/   
**$HighlightColor**; /\* Optional; The highlight color. Default is yellow. Value is the RGB color as integer. Blue\*65536+Green\*256+Red with each color channel having a range from 0 to 255.e.g. MBS( "DynaPDF.RGB"; 0; 0; 255 ) \*/   
**$CaseInsensitive**) /\* Optional; Optional, if 1, the case of the letters is ignored (also umlauts).e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |  |
| Text | The text to search. | "Hello" |  |
| HighlightColor | The highlight color. Default is yellow. Value is the RGB color as integer. Blue\*65536+Green\*256+Red with each color channel having a range from 0 to 255. | MBS( "DynaPDF.RGB"; 0; 0; 255 ) | Optional |
| CaseInsensitive | Optional, if 1, the case of the letters is ignored (also umlauts). | 1 | Optional |

### Result

Returns number of locations found.

### Description

Searches a text and adds highlights for it.  
You need to have an open page. you can use [DynaPDF.EditPage](DynaPDFEditPage.md) to edit an existing one.  
You can use [DynaPDF.RGB](DynaPDFRGB.md) function to calculate RGB color value.  
  
This function uses the parser interface in DynaPDF and needs a Lite license.  
### Examples

Highlight "Apple" with yellow:

 MBS ( "DynaPDF.HighlightPattern"; $PDF ; "Apple"; MBS ( "[DynaPDF.RGB](DynaPDFRGB.md)"; 0; 255; 255 ); 1 )  
Same, but with color calculated ourself:

 MBS ("DynaPDF.HighlightPattern"; $pdf ; "Apple"; 255+255\*256; 1)  
### See also

- [DynaPDF.EditPage](DynaPDFEditPage.md)
- [DynaPDF.Initialize](DynaPDFInitialize.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.RGB](DynaPDFRGB.md)

### Release notes

- **Version 7.4**
    - Changed [DynaPDF.HighlightPattern](http://www.mbsplugins.eu/DynaPDFHighlightPattern.shtml) to create highlight annotations instead of drawing rectangles.
- **Version 7.3**
    - Fixed issue with [DynaPDF.HighlightPattern](http://www.mbsplugins.eu/DynaPDFHighlightPattern.shtml) function.

### Example Databases

- [DynaPDF/Highlight Text](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Highlight%20Text.shtml#2ScriptAnchor_)
- [DynaPDF/PDF Library](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/PDF%20Library.shtml#15ScriptAnchor_)

### Blog Entries

- [DynaPDF Screenshot](https://www.mbsplugins.de/archive/2019-08-29/DynaPDF_Screenshot/monkeybreadsoftware_blog_filemaker)
- [Combine MBS functions to automate processes in FileMaker](https://www.mbsplugins.de/archive/2019-04-11/Combine_MBS_functions_to_autom/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.4pr1](https://www.mbsplugins.de/archive/2017-08-01/MBS_FileMaker_Plugin_version_7/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)
- [MBS FileMaker Plugin 3.5 for OS X/Windows - More than 2100 Functions In One Plugin](https://www.mbsplugins.de/archive/2013-12-17/MBS_FileMaker_Plugin_35_for_OS/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.5pr10](https://www.mbsplugins.de/archive/2013-12-08/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 6/2020, Seite 35](https://filemaker-magazin.de/neuigkeit/4118-Appetithappen-FMM_202006)

This function checks for a license.

Created 18th August 2014 , last changed 19th March 2019

  
[DynaPDF.HighlightAnnot](DynaPDFHighlightAnnot.md) - [DynaPDF.ImportEncryptionSettings](DynaPDFImportEncryptionSettings.md)

[HTML Version](DynaPDFHighlightPattern.shtml)