Skip to main content

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​

KeyTypeDescription
dpinumberResolution in dots per inch. Must be a positive integer.
labelNamestringName of the label in the database. Mutually exclusive with labelData.
labelDataobjectA Label object. Mutually exclusive with labelName.
tableNamestringOptional table to source variable values from when rendering.
keyColumnstring|numberOptional column in tableName to match against key. Requires tableName and key.
keystringOptional value to look up in keyColumn to select the table row. Requires tableName and keyColumn.

Return value​

KeyTypeDescription
datastringBase64-encoded PNG image data.
widthnumberImage width in pixels.
heightnumberImage height in pixels.
mimeTypestringAlways "image/png".

Example​

getLabelBitmap {"labelName": "MyLabel", "dpi": 300}