getLabelPixmap v5.4
Removed
getLabelPixmap was removed in v6.0. To render a label to an image, use getLabelSimulation or getLabelBitmap.
Render a label for a printer at a given resolution. The label is rendered with the printer's color channels, so the image shows the colors the printer can print. The image is returned in the label's natural orientation.
For a monochrome or color printer, the image is a PNG. For a CMYK printer, the
image is a CMYK TIFF. Use mimeType to tell them apart.
To render a label to a printer-independent black and white bitmap, use getLabelBitmap.
Parameter
| Key | Type | Description |
|---|---|---|
| dpi | number | Resolution in dots per inch. Must be a positive integer. |
| printer | string | Printer ID. Required if more than one printer is available. |
| 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 image data. |
| width | number | Image width in pixels. |
| height | number | Image height in pixels. |
| mimeType | string | "image/png" or "image/tiff". |
Example
getLabelPixmap {"labelName": "MyLabel", "dpi": 300}