PrintArea Class

A print area.

example
// Initialize a product with the "card.psd" template and a channel container.
const productDefinition = {
    surfaces: [{
        printAreas: [{
            name: "postCard",
            designFile: "card",
            containers: [{
                    name: "foil",
                    texture: "texture.png",
                    type: "texture"
                }]
        }]
    }]
};

// Load the editor.
CustomersCanvas.IframeApi.loadEditor(iframe, productDefinition)

    // If the editor has been successfully loaded.
    .then(function (editor) {
        // When we get the product.
        editor.getProduct().then(function (product) {
            // Get the fourth container in a print area.
            product.currentSurface.printAreas[0].getContainers()[3]
                // Update this container with new parameters.
                .update({
                    name: "SilverTexture",
                    texture: "silver-texture.jpg"
                });
        });
    });

Methods

Name Description
addContainer

Adds a channel container to the print area.

getContainer

Gets a container by its name.

getContainers

Gets an array of all containers in the print area.

insertContainer

Inserts a channel container into the print area.

moveContainer

Moves a channel container to a new position in the array of containers.

removeContainer

Removes a channel container from the print area.

Properties

id

id: string

Unique identifier.

name

name: string

Item name.