DynaPDF.SetDocInfoEx
--------------------

Sets a document information.

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

MBS( "DynaPDF.SetDocInfoEx"; PDF; DocInfo; Key; Value ) 

**MBS**( **"DynaPDF.SetDocInfoEx";** /\* Sets a document information. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$DocInfo**; /\* The key to set. Can be Author, Creator, Keywords, Producer, Subject, Title or Company.e.g. "Author" \*/   
**$Key**; /\* The key name for custom keys.e.g. "OurID" \*/   
**$Value**) /\* The new value.e.g. "Hello" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| DocInfo | The key to set. Can be Author, Creator, Keywords, Producer, Subject, Title or Company. | "Author" |
| Key | The key name for custom keys. | "OurID" |
| Value | The new value. | "Hello" |

### Result

Returns OK or error.

### Description

Sets a document information.  
The function sets or changes a document info entry. This function supports also user defined keys which can be created or changed if necessary. If the parameter DocInfo is set to Custom the parameter Key must contain a unique key.   
The following keywords are reserved and must not be used as user defined keys:   
- Author
- CreationDate
- GTS\_PDFXVersion
- Keywords
- ModifyDate
- Producer
- Subject
- Title
- Trapped

Note that the function does not check whether a reserved key is used. Using such a key causes maybe errors which are mostly not reported in viewer applications.   
User defined keys should be defined as 7 bit ASCII string and the usage of special characters like /, \\, #, or character codes higher than 127 should be avoided. The value of the document info entry should not contain binary data.   
Modification date can't be set and will always be updated when PDF is closed.  
See also [SetDocInfoEx](https://www.monkeybreadsoftware.com/DynaPDF-Manual/SetDocInfoEx.shtml) function in DynaPDF manual.

### Examples

Set creation date:

 Set Variable \[ $md ; Value: MBS ( "DynaPDF.SetDocInfoEx"; $PDF ; "CreationDate"; ""; "D:20150418131854Z00'00'" ) \]  
### See also

- [DynaPDF.GetDocInfo](DynaPDFGetDocInfo.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.SetDocInfo](DynaPDFSetDocInfo.md)
- [DynaPDF.SetFontEx](DynaPDFSetFontEx.md)

### Release notes

- **Version 8.2**
    - Added [DynaPDF.SetDocInfoEx](http://www.mbsplugins.eu/DynaPDFSetDocInfoEx.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin, version 8.2pr5](https://www.mbsplugins.de/archive/2018-05-02/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin Schulung in 2018](https://www.mbsplugins.de/archive/2018-05-02/MBS_FileMaker_Plugin_Schulung_/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 28th April 2018 , last changed 8th July 2024

  
[DynaPDF.SetDocInfo](DynaPDFSetDocInfo.md) - [DynaPDF.SetDrawDirection](DynaPDFSetDrawDirection.md)

[HTML Version](DynaPDFSetDocInfoEx.shtml)