swapSurfaces Method

Callable

  • Swaps two surfaces (pages) in the product. Returns the product instance where the surfaces (pages) were swapped.

    example
    editor.getProduct()
        // When we get the product.
        .then(function(product) {
            // Swap the first and last pages in the product.
            product.swapSurfaces(product.surfaces[0], product.surfaces[product.surfaces.length - 1])
            // If there was an error while swapping pages in the product.
            .catch(function (error) {
                console.error("Swapping surfaces failed with exception: ", error);
            });
        });
    

    Parameters

    • lhsSurface: Surface

      The first surface (page) to swap.

    • rhsSurface: Surface

      The second surface (page) to swap.

    Returns Promise < Product >

    The product instance where the surfaces (pages) were swapped.