DynaPDF.TestPassword
--------------------

Test the given password against the owner one.

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

MBS( "DynaPDF.TestPassword"; PDF; PasswordType; Password ) 

**MBS**( **"DynaPDF.TestPassword";** /\* Test the given password against the owner one. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$PasswordType**; /\* The password type and flags.   
Flag kann be 1 for owner password and 0 for open password.e.g. 0 \*/   
**$Password**) /\* The password to decrypt the file. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| PasswordType | The password type and flags.    Flag kann be 1 for owner password and 0 for open password. | 0 |
| Password | The password to decrypt the file. | $password |

### Result

Returns OK or error.

### Description

Test the given password against the owner one.  
The main purpose of the function is to test the file against the owner password if the encryption settings should be changed by the user. It is not meaningful to call this function for non-encrypted files. To determine whether a PDF file is encrypted call [DynaPDF.GetInIsEncrypted](DynaPDFGetInIsEncrypted.md).  
See also [TestPassword](https://www.monkeybreadsoftware.com/DynaPDF-Manual/TestPassword.shtml) function in DynaPDF manual.

### See also

- [DynaPDF.GetInIsEncrypted](DynaPDFGetInIsEncrypted.md)
- [DynaPDF.New](DynaPDFNew.md)

### Release notes

- **Version 14.4**
    - Added [DynaPDF.TestPassword](https://www.mbsplugins.eu/DynaPDFTestPassword.shtml) function.

### Blog Entries

- [New in MBS FileMaker Plugin 14.4](https://www.mbsplugins.de/archive/2024-09-24/New_in_MBS_FileMaker_Plugin_14/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 14.4pr5](https://www.mbsplugins.de/archive/2024-08-29/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 27th August 2024 , last changed 27th August 2024

  
[DynaPDF.TestGlyphs](DynaPDFTestGlyphs.md) - [DynaPDF.TestWriteText](DynaPDFTestWriteText.md)

[HTML Version](DynaPDFTestPassword.shtml)