Preserve Edit Area Size on Import

Release 3.1.0+, Release 2.19.0+

When true, the editor's edit-area size is preserved on import (the imported document's page size does not change the editor dimensions). Default: false.

Configuration

OptionTypeDefaultSinceDescription
editor.import.keepContentsSizebooleanfalse2.19.0+Preserve editor dimensions on import
// synapeditor.config.js
{
  'editor.import.keepContentsSize': true
}

Behavior

  • false (default): Importing a document may change the editor's page size to match the dimensions defined in the imported file. The edit area is resized to reflect the imported document's layout.
  • true: The editor's current edit-area dimensions are preserved. The imported content adapts to fit the existing editor size rather than forcing a resize.

Use Cases

This option is useful when the editor is embedded in a fixed-layout UI where the edit area must remain a specific size. Enabling it prevents imported documents from unexpectedly resizing the editor and breaking the surrounding layout.

Comparison

<table> <thead> <tr><th>On</th><th>Off</th></tr> </thead> <tbody> <tr><td><img src="import_keepContentsSize_true.gif" alt="On"></td><td><img src="import_keepContentsSize_false.gif" alt="Off"></td></tr> </tbody> </table>

Related