IBarcodeDefaultConfig Interface

A structure defining the default parameters of barcodes.

The following example illustrates how you can enable two buttons in the Toolbox: the first one opens the standard QrCode dialog box, while the second custom button adds a predefined QR code to the canvas.

example
{
    "widgets": {
        "Toolbox": {
            "buttons": [
                "QrCode",
                {
                    "action": "CustomBarcode",
                    "iconClass": "cc-icon-qr-code",

                    "itemConfig": {
                        "barcodeContent": {
                            "barcodeFormat": "QrUrl",
                            "url": "example.com"
                        },
                        "name": "Custom barcode",
                        "overlayColor": "rgb(255,0,0)",
                        "width": "100",
                        "location": {
                            "originX": "left",
                            "originY": "bottom",
                            "x": "0%",
                            "y": "100%"
                        },
                        "manipulationPermissions": {
                            "allowMoveHorizontal": false,
                            "allowMoveVertical": false,
                            "resizeGrips": {
                                "edge": false,
                                "corner": []
                            }
                        }
                    }
                }
            ]
        }
    }
}

Properties

Optional addImageAsPlaceholder

addImageAsPlaceholder: boolean

Allows adding images to the canvas as placeholders. The default value is false.

Optional angle

angle: number

An angle, which design elements are rotated to. By default, this value is 0.

Optional barcodeContent

The content of barcodes.

Optional borderColor

borderColor: string

The shape border color. The default value is "rgba(0,0,0,255)".

Optional borderWidth

borderWidth: number

The shape border width, in points. The default value is 1.

Optional fillColor

fillColor: string

The fill color. The default value is "rgba(0, 0, 0, 0)".

Optional height

height: number

The barcode height, in points. For QR codes, the IBarcodeDefaultConfig.width value is used for both width and height.

Optional imagePermissions

imagePermissions: IImagePermissionsConfig

Defines permissions for images being added to the canvas.

Optional isVariable

isVariable: boolean

Marks a design element as a variable item. The default value is false.

Optional itemPermissions

itemPermissions: IItemPermissionsConfig

A structure defining the Item Menu and the Floating item toolbar for design elements.

Optional location

The location of design elements being added to the canvas. By default, you can add them to the center of your product.

Optional manipulationPermissions

manipulationPermissions: IManipulationPermissionsConfig

A structure defining the manipulation permissions for design elements.

Optional maskOpacity

maskOpacity: number

The mask opacity of an item. The default value is 0.45.

Optional name

name: string

The name of design elements being added to the canvas.

Optional opacity

opacity: number

An opacity applied to design elements. This value can be from 0 to 1. By default, it is 1.

Optional overlayColor

overlayColor: string

Defines an overlay color for images being added to the canvas.

Optional shapePermissions

shapePermissions: IShapePermissionsConfig

Defines permissions for shapes.

Optional textWrappingMode

textWrappingMode: WrappingModeType

A wrapping mode applied to wrap text around design elements. By default, it is "none".

Optional visualizationPermissions

visualizationPermissions: IVisualizationPermissionsConfig

A structure defining the visualization permissions for design elements.

Optional width

width: number

The barcode width, in points.