GMImage.GetZPL
--------------

Queries image as ZPL hex image.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [GraphicsMagick](component_GraphicsMagick.md) | [10.3](newinversion103.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "GMImage.GetZPL"; ImageRef { ; Flags } ) 

**MBS**( **"GMImage.GetZPL";** /\* Queries image as ZPL hex image. \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$Flags**) /\* Optional; Pass various flags.  
Currently 1 for skipping header/footer.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| ImageRef | The image reference number. | 1 |  |
| Flags | Pass various flags.   Currently 1 for skipping header/footer. | 0 | Optional |

### Result

Returns text or error.

### Description

Queries image as ZPL hex image.  
This is for sending data to a receipt printer. The picture is read as black &amp; white image and we build the hex string, you can send to the printer. You can pass in a color, grayscale or b&amp;w image.  
Picture needs to have a width dividable by 8.  
### Examples

Get ZPL encoded image:

 Set Variable \[ $BigImageRef ; Value: MBS ("[GMImage.NewFromContainer](GMImageNewFromContainer.md)"; Pictures::Image ) \]   
\# put the ZPL image in container:   
Set Field \[ Pictures::Result ; MBS ( "GMImage.GetZPL"; $BigImageRef ) \]   
Set Variable \[ $Error ; Value: MBS ("[GMImage.Free](GMImageFree.md)";$BigImageRef ) \]  
### See also

- [GMImage.Free](GMImageFree.md)
- [GMImage.GetFont](GMImageGetFont.md)
- [GMImage.GetPage](GMImageGetPage.md)
- [GMImage.GetSize](GMImageGetSize.md)
- [GMImage.GetType](GMImageGetType.md)
- [GMImage.GetView](GMImageGetView.md)
- [GMImage.GetXMP](GMImageGetXMP.md)
- [GMImage.New](GMImageNew.md)
- [GMImage.NewFromContainer](GMImageNewFromContainer.md)
- [GMImage.SetXMP](GMImageSetXMP.md)

### Release notes

- **Version 10.3**
    - Added [GMImage.GetZPL](https://www.mbsplugins.eu/GMImageGetZPL.shtml) function.

### Blog Entries

- [What is new in the MBS FileMaker Plugin Version 10.3](https://www.mbsplugins.de/archive/2020-07-31/What_is_new_in_the_MBS_FileMak/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.3pr2](https://www.mbsplugins.de/archive/2020-06-08/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 1st June 2020 , last changed 20th June 2023

  
[GMImage.GetXMP](GMImageGetXMP.md) - [GMImage.Hash](GMImageHash.md)

[HTML Version](GMImageGetZPL.shtml)