Container.DecodeFromHex
-----------------------

Decodes data from hex text into a container value.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Container](component_Container.md) | [6.5](newinversion65.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Container.DecodeFromHex"; Type; Text { ; FileName; DontRenderPreview } ) 

**MBS**( **"Container.DecodeFromHex";** /\* Decodes data from hex text into a container value. \*/  
**$Type**; /\* The type to return. Can be JPEG, TIFF, GIF, PNG, PDF or File.e.g. "JPEG" \*/   
**$Text**; /\* The text to process. \*/   
**$FileName**; /\* Optional; If filter is container, this defines the file name to use.e.g. "test.txt" \*/   
**$DontRenderPreview**) /\* Optional; Pass 1 to not create a JPEG with preview of first page as part of the container. (only for returning PDF)e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Type | The type to return. Can be JPEG, TIFF, GIF, PNG, PDF or File. | "JPEG" |  |
| Text | The text to process. |  |  |
| FileName | If filter is container, this defines the file name to use. | "test.txt" | Optional |
| DontRenderPreview | Pass 1 to not create a JPEG with preview of first page as part of the container. (only for returning PDF) | 0 | Optional |

### Result

Returns container or error.

### Description

Decodes data from hex text into a container value.  
If you have a DynaPDF Pro license and [DynaPDF](component_DynaPDF.md) functions initialized, this function can add previews for the PDF file on Windows and Linux. For MacOS, we make them with PDFKit.  
### Examples

Decode hex encoded zlib compressed PDF in a text field:

 Set Field \[ PDF::PDFFile ; MBS ( "[Container.Decompress](ContainerDecompress.md)"; MBS ( "[Container.RenameStream](ContainerRenameStream.md)"; MBS ( "Container.DecodeFromHex"; "FILE"; PDF::PDF\_hex ; "test.pdf"); "FILE"; "ZLIB" )) \]  
### See also

- [Archive.GZipDecompress](ArchiveGZipDecompress.md)
- [Container.DecodeFromBase64](ContainerDecodeFromBase64.md)
- [Container.Decompress](ContainerDecompress.md)
- [Container.Rename](ContainerRename.md)
- [Container.RenameStream](ContainerRenameStream.md)
- [Text.EncodeToHex](TextEncodeToHex.md)
- [Text.ReadTextFromContainer](TextReadTextFromContainer.md)

### Example Databases

- [SmartCard/Belgian EID Reader](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SmartCard/Belgian%20EID%20Reader.shtml#3ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 6.5pr9](https://www.mbsplugins.de/archive/2016-12-05/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 30th November 2016 , last changed 1st May 2022

  
[Container.DecodeFromBase64](ContainerDecodeFromBase64.md) - [Container.Decompress](ContainerDecompress.md)

[HTML Version](ContainerDecodeFromHex.shtml)