DynaPDF.FindText
----------------

Searches a text and returns position details.

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

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

**MBS**( **"DynaPDF.FindText";** /\* Searches a text and returns position details. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Text**; /\* The text to search.e.g. "Hello" \*/   
**$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" |  |
| CaseInsensitive | Optional, if 1, the case of the letters is ignored (also umlauts). | 1 | Optional |

### Result

Returns list of found positions.

### Description

Searches a text and returns position details.  
You need to have an open page. you can use [DynaPDF.EditPage](DynaPDFEditPage.md) to edit an existing one.  
The list of returned coordinates contains a rectangle for each found position defined by 4 coordinates. The coordinates (x1 y1 x2 y2 x3 y3 x4 y4) define the surrounding rectangle of the text area.  
  
This function uses the parser interface in DynaPDF and needs a Lite license.  
See also [FindText](https://www.monkeybreadsoftware.com/DynaPDF-Manual/FindText.shtml) function in DynaPDF manual.

### Examples

Find the text Apple on the current page:

 MBS ( "DynaPDF.FindText"; $PDF ; "Apple"; 1 )  
<small>  
Example result: "96.001800 662.040000 168.307802 662.040000 168.307802 676.080000 96.001800 676.080000"</small>Find text and place weblink:

 Set Variable \[ $pos ; Value: MBS ( "DynaPDF.FindText"; $pdf ; Links::Text ; 1) \]   
If \[ IsEmpty ( $pos ) \]   
 # not found  
Else  
 # read positions  
 Set Variable \[ $pos ; Value: Substitute($pos ; " "; ¶) \]   
 Set Variable \[ $x1 ; Value: MBS ( "[Math.TextToNumber](MathTextToNumber.md)"; GetValue($pos ; 1)) \]   
 Set Variable \[ $y1 ; Value: MBS ( "[Math.TextToNumber](MathTextToNumber.md)"; GetValue($pos ; 2)) \]   
 Set Variable \[ $x2 ; Value: MBS ( "[Math.TextToNumber](MathTextToNumber.md)"; GetValue($pos ; 3)) \]   
 Set Variable \[ $xy ; Value: MBS ( "[Math.TextToNumber](MathTextToNumber.md)"; GetValue($pos ; 4)) \]   
 Set Variable \[ $x3 ; Value: MBS ( "[Math.TextToNumber](MathTextToNumber.md)"; GetValue($pos ; 5)) \]   
 Set Variable \[ $y3 ; Value: MBS ( "[Math.TextToNumber](MathTextToNumber.md)"; GetValue($pos ; 6)) \]   
 Set Variable \[ $x4 ; Value: MBS ( "[Math.TextToNumber](MathTextToNumber.md)"; GetValue($pos ; 7)) \]   
 Set Variable \[ $y4 ; Value: MBS ( "[Math.TextToNumber](MathTextToNumber.md)"; GetValue($pos ; 8)) \]   
 Set Variable \[ $w ; Value: MBS ( "[Math.TextToNumber](MathTextToNumber.md)"; $x3 -$x1 ) \]   
 Set Variable \[ $h ; Value: MBS ( "[Math.TextToNumber](MathTextToNumber.md)"; $y3 -$y1 ) \]   
 # place web link  
 Set Variable \[ $r ; Value: MBS ( "[DynaPDF.WebLink](DynaPDFWebLink.md)"; $pdf ; $x1 ; $y1 ; $w ; $h ; Links::URL ) \]   
End If  
### See also

- [DynaPDF.EditPage](DynaPDFEditPage.md)
- [DynaPDF.FindField](DynaPDFFindField.md)
- [DynaPDF.Initialize](DynaPDFInitialize.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.PageLink](DynaPDFPageLink.md)
- [DynaPDF.Parser.ExtractText](DynaPDFParserExtractText.md)
- [DynaPDF.Rectangle](DynaPDFRectangle.md)
- [DynaPDF.WebLink](DynaPDFWebLink.md)
- [DynaPDF.WriteText](DynaPDFWriteText.md)
- [Math.TextToNumber](MathTextToNumber.md)

### Example Databases

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

### Blog Entries

- [MBS FileMaker Advent calendar - Door 6 - Sending Out Wishlist Forms](https://www.mbsplugins.de/archive/2024-12-06/MBS_FileMaker_Advent_calendar_/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)
- [PDF Forms with MBS Plugin](https://www.mbsplugins.de/archive/2018-04-21/PDF_Forms_with_MBS_Plugin/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 4.1 for OS X/Windows - More than 2400 Functions In One Plugin](https://www.mbsplugins.de/archive/2014-03-18/MBS_FileMaker_Plugin_41_for_OS/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.1pr1](https://www.mbsplugins.de/archive/2014-02-16/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 1/2022, Seite 20](https://filemaker-magazin.de/neuigkeit/4172-Appetithappen-FMM_202201)
- [Ausgabe 3/2019, Seite 37 bis 38](https://filemaker-magazin.de/neuigkeit/4046-Appetithappen-FMM_201903)

This function checks for a license.

Created 18th August 2014 , last changed 4th May 2020

  
[DynaPDF.FindPattern](DynaPDFFindPattern.md) - [DynaPDF.FlattenAnnotOrField](DynaPDFFlattenAnnotOrField.md)

[HTML Version](DynaPDFFindText.shtml)