Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
11.0
11.1
11.2
11.3
11.4
11.5
12.0
12.1
12.2
12.3
Statistic
FMM
Blog
DynaPDF.FindText
Searches a text and returns position details.
Component | Version | macOS | Windows | Linux | Server | iOS SDK | License |
DynaPDF | 4.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | Paid |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
The PDF reference returned from DynaPDF.New. | |||
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 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.
Examples
Find the text Apple on the current page:
MBS( "DynaPDF.FindText"; $PDF; "Apple"; 1 )
Example result: "96.001800 662.040000 168.307802 662.040000 168.307802 676.080000 96.001800 676.080000"
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"; GetValue($pos; 1)) ]
Set Variable [ $y1 ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 2)) ]
Set Variable [ $x2 ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 3)) ]
Set Variable [ $xy ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 4)) ]
Set Variable [ $x3 ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 5)) ]
Set Variable [ $y3 ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 6)) ]
Set Variable [ $x4 ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 7)) ]
Set Variable [ $y4 ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 8)) ]
Set Variable [ $w ; Value: MBS( "Math.TextToNumber"; $x3-$x1) ]
Set Variable [ $h ; Value: MBS( "Math.TextToNumber"; $y3-$y1) ]
# place web link
Set Variable [ $r ; Value: MBS( "DynaPDF.WebLink"; $pdf; $x1; $y1; $w; $h; Links::URL ) ]
End If
See also
- DynaPDF.EditPage
- DynaPDF.FileLink
- DynaPDF.FindField
- DynaPDF.Initialize
- DynaPDF.New
- DynaPDF.PageLink
- DynaPDF.Rectangle
- DynaPDF.WebLink
- DynaPDF.WriteText
- Math.TextToNumber
Example Databases
Blog Entries
- Example Script for DynaPDF.FindText and DynaPDF.WebLink
- MBS FileMaker Plugin 4.1 for OS X/Windows - More than 2400 Functions In One Plugin
- MBS Filemaker Plugin, version 4.1pr1
FileMaker Magazin
Created 18th August 2014, last changed 4th May 2020
DynaPDF.FindPattern - DynaPDF.FlattenAnnotOrField
Feedback: Report problem or ask question.
