Skip to main content

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​

KeyTypeDescription
dpinumberResolution in dots per inch. Must be a positive integer.
printerstringPrinter ID. Required if more than one printer is available.
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 image data.
widthnumberImage width in pixels.
heightnumberImage height in pixels.
mimeTypestring"image/png" or "image/tiff".

Example​

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