getLabelBitmap v5.2.4
Render a label to a bi-level (black and white) PNG image at a given resolution. Unlike getLabelSimulation, the result does not depend on any printer's settings: the label is rendered in monochrome, with grayscale and color content dithered, and the image is returned in the label's natural orientation.
Parameter
| Key | Type | Description |
|---|---|---|
| dpi | number | Resolution in dots per inch. Must be a positive integer. |
| labelName | string | Name of the label in the database. Mutually exclusive with labelData. |
| labelData | object | A Label object. Mutually exclusive with labelName. |
| tableName | string | Optional table to source variable values from when rendering. |
| keyColumn | string|number | Optional column in tableName to match against key. Requires tableName and key. |
| key | string | Optional value to look up in keyColumn to select the table row. Requires tableName and keyColumn. |
Return value
| Key | Type | Description |
|---|---|---|
| data | string | Base64-encoded PNG image data. |
| width | number | Image width in pixels. |
| height | number | Image height in pixels. |
| mimeType | string | Always "image/png". |
Example
getLabelBitmap {"labelName": "MyLabel", "dpi": 300}