DynaPDF.AddFontSearchPath
-------------------------

Adds a search path to the list of available font search paths.

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

MBS( "DynaPDF.AddFontSearchPath"; PDF; Path; Recursive ) 

**MBS**( **"DynaPDF.AddFontSearchPath";** /\* Adds a search path to the list of available font search paths. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Path**; /\* Path to font file directory or path to font file.e.g. "C:\\Fonts" \*/   
**$Recursive**) /\* Include subdirectories (search recursively).   
Pass 1 for recursive or 0 for not recursive.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Path | Path to font file directory or path to font file. | "C:\\Fonts" |
| Recursive | Include subdirectories (search recursively).    Pass 1 for recursive or 0 for not recursive. | 1 |

### Result

Returns number of fonts loaded or error message.

### Description

Adds a search path to the list of available font search paths.   
An arbitrary number of search paths can be added at runtime. Subdirectories are added recursively if the parameter Recursive is 1.  
Result may be 0 if all those fonts in were already loaded.  
See also [AddFontSearchPath](https://www.monkeybreadsoftware.com/DynaPDF-Manual/AddFontSearchPath.shtml) function in DynaPDF manual.

### Examples

Load font folder on Windows:

 MBS ( "DynaPDF.AddFontSearchPath"; $pdf ; "C:\\Fonts"; 1 )  
Load font folder on Linux:

 MBS ( "DynaPDF.AddFontSearchPath"; $PDF ; "/usr/share/fonts"; 1 )  
### See also

- [DynaPDF.GetUseSystemFonts](DynaPDFGetUseSystemFonts.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.SetUseSystemFonts](DynaPDFSetUseSystemFonts.md)
- [Font.Activate](FontActivate.md)

### Release notes

- **Version 11.4**
    - Fixed [DynaPDF.AddFontSearchPath](https://www.mbsplugins.eu/DynaPDFAddFontSearchPath.shtml) to return no error, but zero, when no fonts are found.

### Blog Entries

- [MBS FileMaker Plugin, version 11.4pr4](https://www.mbsplugins.de/archive/2021-08-30/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Install fonts for PDF generation in FileMaker Cloud](https://www.mbsplugins.de/archive/2017-12-11/Install_fonts_for_PDF_generati/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.1pr5](https://www.mbsplugins.de/archive/2014-03-14/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 25th June 2026

  
[DynaPDF.AddFieldToFormAction](DynaPDFAddFieldToFormAction.md) - [DynaPDF.AddJavaScript](DynaPDFAddJavaScript.md)

[HTML Version](DynaPDFAddFontSearchPath.shtml)