DynaPDF.ImportEncryptionSettings
--------------------------------

Imports the encryption settings from the currently open import file.

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

MBS( "DynaPDF.ImportEncryptionSettings"; PDF ) 

**MBS**( **"DynaPDF.ImportEncryptionSettings";** /\* Imports the encryption settings from the currently open import file. \*/  
**$PDF**) /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |

### Result

Returns OK or error.

### Description

Imports the encryption settings from the currently open import file.  
If the PDF file is not encrypted, the function does nothing. To determine whether the open PDF file is encrypted call [DynaPDF.GetInIsEncrypted](DynaPDFGetInIsEncrypted.md).   
The encryption settings should be imported to make sure that the PDF file can be saved with the same settings after it was edited. The user rights should be considered if the file was opened with the open password, also if the password was just an empty string. See [DynaPDF.GetUserRights](DynaPDFGetUserRights.md) for further information.   
If the file was opened with the owner password, then all editing rights should be grated. The PDF file must be closed with DynaPDF.CloseFile or DynaPDF.CloseAndSignFile for example. Don't use DynaPDF.CloseFileEx for example since this function would override the encryption settings. If the file should be saved unencrypted call [DynaPDF.ResetEncryptionSettings](DynaPDFResetEncryptionSettings.md)() before closing the file. If the function succeeds the return value is 1. If the function fails the return value is 0.   
See also [ImportEncryptionSettings](https://www.monkeybreadsoftware.com/DynaPDF-Manual/ImportEncryptionSettings.shtml) function in DynaPDF manual.

### See also

- [DynaPDF.GetInIsEncrypted](DynaPDFGetInIsEncrypted.md)
- [DynaPDF.GetUserRights](DynaPDFGetUserRights.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.ResetEncryptionSettings](DynaPDFResetEncryptionSettings.md)

This function checks for a license.

Created 19th January 2017 , last changed 19th January 2017

  
[DynaPDF.HighlightPattern](DynaPDFHighlightPattern.md) - [DynaPDF.ImportPDFFile](DynaPDFImportPDFFile.md)

[HTML Version](DynaPDFImportEncryptionSettings.shtml)