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:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
DynaPDF.ReplacePattern
Replaces a text with a new text.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 3.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
The PDF reference returned from DynaPDF.New. | |||
Text | The text to search. | "Hello" | |
NewText | The text to replace the found location with. | "World" | |
Alignment | The new alignment you want. 0 = Left, 1 = Center and 2 = Right. May not work with rotated text. | 0 | Optional |
NewFontSize | The new font size to use. Use -1 to keep whatever it is. Due to matrix scaling in pdf, the size here may be far off. | Optional | |
NewFontStyle | The new font style. Use -1 to keep whatever it is. e.g. 4 for underline, 2 for bold, 1 for italic or a combination. See dynapdf manual for more values for font styles. | 0 | Optional |
NewCharacterSpacing | The new character spacing value. See also DynaPDF.SetCharacterSpacing. If undefined, keeps current character spacing. |
2 | Optional |
NewTextScaling | The text scaling to use. | Optional | |
NewTextRise | The text rise to use. In percent of text height as plugin multipies y by given factor. |
Optional | |
NewTextColor | Available in MBS FileMaker Plugin 9.1 or newer. The new stroke & fill color. Pass negative number to keep existing color. |
MBS( "DynaPDF.RGB"; 0; 0; 255 ) | Optional |
Result
Returns number of locations found.
Description
Replaces a text with a new text.You need to have an open page. you can use DynaPDF.EditPage to edit an existing one.
Needs DynaPDF Pro license.
Examples
Replace placeholder with text:
MBS("DynaPDF.ReplacePattern"; $pdf; "<<PLZ Ort>>"; "56645 Nickenich")
Replace some texts with different alignment:
Set Variable [ $r1 ; Value: MBS("DynaPDF.ReplacePattern"; $pdf; "Hello1"; "Hello World"; 0) ]
Set Variable [ $r2 ; Value: MBS("DynaPDF.ReplacePattern"; $pdf; "Hello3"; "Hello World"; 1) ]
Set Variable [ $r3 ; Value: MBS("DynaPDF.ReplacePattern"; $pdf; "Hello5"; "Hello World"; 2) ]
Replace text, make it centered and underlined:
MBS("DynaPDF.ReplacePattern"; $pdf; "Hello3"; "Hello World"; 1; -1; 4)
See also
Release notes
- Version 12.2
- Changed DynaPDF.ReplacePattern to fallback to Courier (fixed pitch), Times (serif) or Helvetica as font.
- Version 9.3
- Fixed a problem with DynaPDF.ReplacePattern function and fonts missing the CID Ordering table.
- Version 9.1
- Added NewTextColor parameter for DynaPDF.ReplacePattern function.
- Version 8.3
- Fixed bug in DynaPDF.ReplacePattern when new text was added behind existing text instead before.
Example Databases
Blog Entries
- MBS Plugin 12.2 for Claris FileMaker
- MBS FileMaker Plugin, version 12.2pr1
- MBS FileMaker Plugin, version 9.3pr1
- MBS FileMaker Plugin 9.1 - More than 5700 Functions In One Plugin
- MBS FileMaker Plugin, version 9.1pr2
- MBS FileMaker Plugin, version 8.3pr2
- MBS FileMaker Plugin, version 6.5pr6
- MBS FileMaker Plugin, version 5.5pr4
- MBS FileMaker Plugin, version 5.2pr1
- MBS Filemaker Plugin, version 3.4pr2
This function checks for a license.
Created 18th August 2014, last changed 22nd October 2021
