DynaPDF.SetSpaceWidthFactor
---------------------------

Sets space width factor.

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

MBS( "DynaPDF.SetSpaceWidthFactor"; PDF; Value ) 

**MBS**( **"DynaPDF.SetSpaceWidthFactor";** /\* Sets space width factor. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Value**) /\* The new value to use.  
Default is 0.7e.g. 0.75 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Value | The new value to use.   Default is 0.7 | 0.75 |

### Result

Returns OK or error.

### Description

Sets space width factor.  
Sets the space width factor that is used by [DynaPDF.ExtractText](DynaPDFExtractText.md) to determine whether the distance between two text records or glyphs should be interpreted as space character.   
PDF files do often not contain space characters. Depending on the font type, i.e. fixed pitch or proportional fonts, different default widths are used during text extraction. However, the full space width is mostly too large to find spaces. Therefore, the text extraction algorithm multiplies the default space width with the space width factor to find suitable values.   
The default value is 0.7. Increase the value if too many spaces occur in extracted text and decrease the value if too few spaces were found.   
The value must be large zero. Although the upper bound is not restricted, values larger than 2 are mostly not meaningful.   
See also [SetSpaceWidthFactor](https://www.monkeybreadsoftware.com/DynaPDF-Manual/SetSpaceWidthFactor.shtml) function in DynaPDF manual.

### Examples

Set a slightly higher factor:

 Set Variable \[ $r ; Value: MBS ( "DynaPDF.SetSpaceWidthFactor"; $PDF ; 0.75 ) \]  
### See also

- [DynaPDF.ExtractText](DynaPDFExtractText.md)
- [DynaPDF.GetSpaceWidthFactor](DynaPDFGetSpaceWidthFactor.md)
- [DynaPDF.New](DynaPDFNew.md)

### Release notes

- **Version 12.1**
    - Added [DynaPDF.GetSpaceWidthFactor](https://www.mbsplugins.eu/DynaPDFGetSpaceWidthFactor.shtml) and [DynaPDF.SetSpaceWidthFactor](https://www.mbsplugins.eu/DynaPDFSetSpaceWidthFactor.shtml) functions.

### Blog Entries

- [The challenges of PDF text extraction](https://www.mbsplugins.de/archive/2025-07-10/The_challenges_of_PDF_text_ext/monkeybreadsoftware_blog_filemaker)
- [Top 10 from the MBS Plugin in 2022](https://www.mbsplugins.de/archive/2022-12-29/Top_10_from_the_MBS_Plugin_in_/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 12.1](https://www.mbsplugins.de/archive/2022-03-22/New_in_MBS_FileMaker_Plugin_12/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 12.1](https://www.mbsplugins.de/archive/2022-03-15/Neues_MBS_FileMaker_Plugin_121/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 12.1 - More than 6700 Functions In One Plugin](https://www.mbsplugins.de/archive/2022-03-15/MBS_FileMaker_Plugin_121_-_Mor/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.1pr3](https://www.mbsplugins.de/archive/2022-02-16/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 15th February 2022 , last changed 15th February 2022

  
[DynaPDF.SetSeparationInfo](DynaPDFSetSeparationInfo.md) - [DynaPDF.SetStrokeColor](DynaPDFSetStrokeColor.md)

[HTML Version](DynaPDFSetSpaceWidthFactor.shtml)