Skip to main content
Skip table of contents

Barcode dictionary keys

This page applies to Harlequin v13.1r0 and later; both Harlequin Core and Harlequin MultiRIP

Key

Name

Required

Default

Values

/Background

Array

Optional

No background, i.e., a transparent background

An array of color components appropriate to the color space, specifying a single background color value. If present, this color is used as the background of the barcode and will knock out everything behind. If this is not specified, there will be no background (i.e. transparent) and what has already been painted will show through.

/ColorSpace

Array or Name

Optional

Current PS color space

Use this color space when specifying barcode colors rather than the current PS color space.

/Foreground

Array

Optional

Current PS color.

An array of color components appropriate to the color space, specifying a single foreground color value. If present, this color is used as the foreground of the barcode. If this is not specified, the PS current color will be uses as the foreground color.

/Input

String

Yes

The data to be encoded in the barcode. All strings are encoded using UTF-8 bytes.

/Option1, /Option2, /Option3

Integer

Sometimes

Depends

Option1, Option2, and Option3 are used to provide symbology-specific control values.

See Barcode symbologies for values to use for Options.

/Symbology

Name or Integer

Yes

-

Specifies which symbology to render. See Barcode symbologies

Table: Barcode dictionary keys Core values

Key

Type

Required

Default

Values

/HeightProportionalToWidth

Boolean

Optional

true

Applies to 1D & 2D barcodes. If width is adjusted (for any reason), the height will also be adjusted to keep the barcode in proportion. Only applies if a /TargetWidthHeight or /HorizontalModuleWidth has been specified, otherwise it is effectively ignored. It overrides /VerticalModuleWidth and any Min/Max/Target height specified although /TargetWidthHeight is still used for alignment.

/HorizontalModuleWidth

Integer

Optional

1/72"

Specifies how many horizontal device pixels a barcode module ought to use. Can be used for 1D and 2D barcodes. If /TargetWidthHeight width is specified (i.e. non-zero) an error will be raised, and the job will abort.

If /MinTargetWidth or /MaxTargetWidth widths are set, and would be breached if /HorizontalModuleWidth is applied, then /UnableToPixelSnapBehavior behavior will be invoked.

/MaxWidthHeight

Array

Optional

[ 0, 0 ], no

max size

Specifies the maximum allowable size of the barcode in points (1/72"). If not specified, no maximum size is specified.

This setting only applies if a /TargetWidthHeight or /HorizontalModuleWidth or /VerticalModuleWidth has been specified, otherwise it is ignored.

/UnableToPixelSnapBehavior

Name

Optional

/Unsnapp ed

If /PixelSnapping is true, and the barcode cannot be scaled to meet the requirements of /HorizontalModuleWidth , /VerticalModuleWidth , /TargetWidthHeight , /MinWidthHeight , /MaxWidthHeight , raise a PS error and abort the job if the value is /Error .

If /Nearest , will use the closest snapped size which will always be larger than /TargetWidthHeight and /MaxWidthHeight (if specified).

If /Unsnapped , the barcode will be scaled to fit into /TargetWidthHeight precisely, but this will mean that some modules will not be an exact number of device pixels wide or high.

/VerticalModuleWidth

Integer

Optional

1/72"

Specifies how many vertical device pixels a barcode module ought to use. Can be used for 1D and 2D barcodes.

If /TargetWidthHeight height is specified (i.e. non-zero) an error will be raised, and the job will abort.

If /MinTargetWidth or /MaxTargetWidth heights are set, and would be breached if /HorizontalModuleWidth is applied, then /UnableToPixelSnapBehavior behavior will be invoked.

Table: Barcode dictionary keys Symbol snapping and size

Key

Type

Required

Default

Values

/HorizontalAlignment

Name object

Optional

/Left

/Left , /Right , /Center

Specify how to horizontally align the barcode in the /TargetWidthHeight bounding box if the target rectangle has been specified.

If no /TargetWidthHeight is specified, then the barcode is aligned around the current point.

If the width is specified as zero, then alignment is done around the current point x.

/VerticalAlignment

Name object

Optional

/Bottom

/Top , /Bottom , /Center

Specify how to vertically align the barcode in the /TargetWidthHeight bounding box if the target rectangle has been specified.

If no /TargetWidthHeight is specified, then the barcode is aligned around the current point.

If the height is specified as zero, then alignment is done around the current point y.

Table: Barcode dictionary keys Symbol alignment

Key

Type

Required

Default

Values

/HorizontalEdgeGrowth

Integer

Optional

0

Expand or contract (erode) bars in the horizontal (X) direction by the specified number of device pixels. A negative value represents erosion, a positive value represents expansion.

Using a large enough negative value that a module would be eroded to less than 1 device pixel will trigger an error. Note that this is edge growth in the current barcode space; if the barcode, or the page in which it is placed, are rotated then the X and Y values may need to be swapped.

/VerticalEdgeGrowth

Integer

Optional

0

Expand or contract (erode) bars in the vertical (Y) direction by the specified number of device pixels. See HorizontalEdgeGrowth for more notes.

NOTE: VerticalEdgeGrowth only applies to 2D barcodes such as QR Codes.

Table: Barcode dictionary keys Edge growth and erosion

Key

Type

Required

Default

Values

/ShowText

Boolean

Optional

false

Show human readable text for data in the symbol. If a character in the data does not have a printable representation in the font selected, then it is not displayed.

Note: The barcode operator does not add text to 2D barcodes.

/TextFont

Key

Required if ShowText is true

None

Selects the font whose name is the Key. The font is selected in the same way as Key is used for the PS operator “selectfont”. If /ShowText is true , this key must also be set to a valid font.

/TextColor

Array

Optional

Current PS color.

An array of color components appropriate to the color space, specifying a single text color value. If present, this color is used as text color of the barcode. If this is not specified, the PS current color will be used as the text color.

/TextSize

Real

Optional

1

The font size of the text in points. Note that the default of 1 is likely to be too small.

Table: Barcode dictionary keys Text properties

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.