---
title: "setPrintAreas Method"
canonical: https://customerscanvas.com/docs/cc5/customerscanvas.iframeapi.objectmodel.surface.setprintareas.htm
archived: true
applies_to:
  - product: "Customer's Canvas On-Premises"
  - product: "Design Editor"
    versions: ["5.35.9", "5.x (may differ)"]
---

**You’re viewing outdated documentation.** [View the latest Customer’s Canvas On-Premises documentation](https://customerscanvas.com/docs/on-premises/).

# setPrintAreas Method

**Applies to:** Customer's Canvas On-Premises; Design Editor 5.35.9, 5.x (may differ) · **Archived documentation**
 
### Callable
 
- setPrintAreas(printAreas:  ( [IPrintAreaTemplate](https://customerscanvas.com/docs/cc5/customerscanvas.iframeapi.objectmodel.iprintareatemplate.htm.md)  |  [IPrintAreaDefinition](https://customerscanvas.com/docs/cc5/customerscanvas.iframeapi.objectmodel.iprintareadefinition.htm.md) ) [], options?:  object ) :  Promise &lt; [Product](https://customerscanvas.com/docs/cc5/customerscanvas.iframeapi.objectmodel.product.htm.md) &gt;

- Sets a new print area for the surface and returns a new product instance containing the changed surface.
  
    As a result, **setPrintAreas** moves only texts and image placeholders to new positions and drops other design elements. By default, this method changes the content of placeholders having the same layer names on the current [Surface](https://customerscanvas.com/docs/cc5/customerscanvas.iframeapi.objectmodel.surface.htm.md) and in the new layout. To maintain the rest elements, set **replaceAll** to `true`. In this case, the rest of placeholders take content in a random order according to their type. If the old layout had more placeholders than the new layout, then extra placeholders are removed.
 
    If the current print area and the new print area have different sizes, you can specify whether to update the surface size to match the new print area by using the **updateSurfaceSize** option.
 
 - example
     - ```
    var newPrintAreas = [{ designFile: "stamp" }];
    var options = { 
        replaceAll: true,
        preserveSafetyLines: false,
        updateSurfaceSize: true
    };
    editor.getProduct()
        .then(function (product) {
            return product.surfaces[0].setPrintAreas(newPrintAreas, options);
        })
        .then(function (product) {
            console.log("The print area was successfully set for the product " + product.id);
        })
        .catch(function (error) {
            console.error("Failed to set up the print area: ", error);
        });
    ```

#### Parameters

    - ##### printAreas: ( [IPrintAreaTemplate](https://customerscanvas.com/docs/cc5/customerscanvas.iframeapi.objectmodel.iprintareatemplate.htm.md)  |  [IPrintAreaDefinition](https://customerscanvas.com/docs/cc5/customerscanvas.iframeapi.objectmodel.iprintareadefinition.htm.md) ) [] 
  
        Print areas to set.
    - #####  Optional options: object 
  
        Additional configuration settings for the print areas.

        - #####  Optional preserveSafetyLines:  boolean 
  
            If `true`, the current safety lines, if any, are restored in new print areas. If `false`, safety lines from new print areas are applied. The default value is `true`.
        - #####  Optional preserveUserChanges:  boolean 
  
            If `true`, the changes made by a user are restored in the new print areas if it is possible. Otherwise, all changes made by the user are wiped. The default value is `true`.
        - #####  Optional replaceAll:  boolean 
  
            If `true`, design elements whose names do not match move to the new print area in a random order according to their types. If `false`, only design elements with the same names are moved to the new print area. The default value is `false`.
        - #####  Optional updateRevertData:  boolean 
  
            If `true`, the new print areas are stored as ones to restore when the product is reverted. Otherwise, the previously stored print areas are restored on product revert. The default value is `true`.
        - #####  Optional updateSurfaceSize:  boolean 
  
            If `true`, changes the surface size to match the new print area. If it's `false` and a mockup is defined, then the surface size remains unchanged. By default, **updateSurfaceSize** is `false`, and the surface size changes only if no mockups are specified for the surface.

#### Returns Promise &lt; Product &gt;
 
    A new product instance containing the changed surface.
