White paper: Templates in web-to-print.  Free download

IframeApi Module

The Iframe Api module. It provides data and methods for a product handling.

Modules

Name Description
Commands

The CommandManager.

Configuration

The Customer's Canvas configuration.

ObjectModel

The object model of Customer's Canvas products.

PostMessage

This module carries out the Events processing.

Classes

Name Description
Editor

Represents the Design Editor.

RuntimeConfiguration

Allows you to get and set the user ID and PDF metadata of a product at runtime.

Functions

Name Description
loadEditor

Loads the web-to-print editor.

preload

Preloads resources of the web-to-print editor.

Variables

Let editorUrl

editorUrl: string

URL to your Customer's Canvas instance.

Typically, you do not have to specify this URL explicitly. If you add id="CcIframeApiScript" to the script tag which links the IframeApi.js, Customer's Canvas automatically detects this URL from the script source. However, if for any reasons you do not want to use the id in the script tag, you can use this property to specify the URL to the Customer's Canvas instance explicitly.

example
<script> 
    CustomersCanvas = {
        IframeApi: {
            editorUrl: "http://example.com/" 
        }
    }; 
</script> 

<script type="text/javascript" src="http://example.com/Resources/Generated/IframeApi.js">
</script>

<script>
    //....
    var editor = null;
    CustomersCanvas.IframeApi.loadEditor(iframe, productDefinition)
        .then(function(e) {
            editor = e
        });
</script>