Skip to content

ExportSettings

typescript
declare type ExportSettings = ExportSettingsImage | ExportSettingsSVG;

ExportSettingsImage

typescript
interface ExportSettingsImage {
  readonly format: "JPG" | "PNG";
  readonly contentsOnly?: boolean;
  readonly useAbsoluteBounds?: boolean;
  readonly suffix?: string;
  readonly constraint?: ExportSettingsConstraints;
}

interface ExportSettingsConstraints {
  readonly type: "SCALE" | "WIDTH" | "HEIGHT";
  readonly value: number;
}

ExportSettingsSVG

typescript
interface ExportSettingsSVG {
  readonly format: "SVG";
  readonly contentsOnly?: boolean;
  readonly useAbsoluteBounds?: boolean;
  readonly suffix?: string;
  readonly svgIdAttribute?: boolean;
}
  • contentsOnly: Whether to export only the contents of the node, the default is true.

  • useAbsoluteBounds: Use the full size of the node, regardless of whether it is clipped or the space around it is empty, defaults to false.

  • suffix: The suffix appended to the file name when exporting, defaults to an empty string.

  • constraint: Limit on image size when exporting. Default is { type: "SCALE", value: 1 }

    • SCALE: The size of the exported image is proportional to the size of the exported layer in Pixso. A value of 1 means exporting at 100% of the layer size.
    • WIDTH: The exported image is scaled to have a fixed width value.
    • HEIGHT: The exported image is scaled to have a fixed height value.
  • svgIdAttribute: Whether to include the layer name as an ID attribute in SVG.