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  


Searches a text and adds highlights for it.

Component Version macOS Windows Linux Server iOS SDK License
DynaPDF 3.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes Paid
MBS( "DynaPDF.HighlightPattern"; PDF; Text { ; HighlightColor; CaseInsensitive } )   More


Parameter Description Example Flags
PDF The PDF reference returned from DynaPDF.New. $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


Returns number of locations found.


Searches a text and adds highlights for it.
You need to have an open page. you can use DynaPDF.EditPage to edit an existing one.
You can use DynaPDF.RGB function to calculate RGB color value.

This function uses the parser interface in DynaPDF and needs a Lite license.


Highlight "Apple" with yellow:

MBS( "DynaPDF.HighlightPattern"; $PDF; "Apple"; MBS( "DynaPDF.RGB"; 0; 255; 255 ); 1 )

Same, but with color calculated ourself:

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

See also

Release notes

Example Databases

Blog Entries

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

DynaPDF.HighlightAnnot - DynaPDF.ImportEncryptionSettings

Feedback: Report problem or ask question.

Start Chat