Basic Configuration Settings of PhotoEditor SDK
In this example, we will show you how to configure the PhotoEditor SDK.
The PE.SDK comes with a set of basic configuration parameters that let you influence its look & feel.
The PhotoEditor SDK license. If no license (or an invalid license) is provided the PE.SDK will render a watermark over the preview and export output. Refer to the pricing plans for more information.
Defines the HTML element the editor will be injected into.
Defines the image that should be displayed once the editor is loaded. This can be a
HTMLImageElement or a file
path that is relative to the
image is set to
undefined the editor will initialise with a blank canvas and the user is able to select an image from the
Custom tool. All other tools will be disabled until an image is loaded.
Defines the root for all assets that are used by the PE.SDK. This can be an URL to a CDN or an absolute path to a local folder which is served by the webserver.
Modify the path to a loaded asset that is relative to the
(item: string, category: string) => string
Modify the absolute path of a loaded asset.
(fullPath: string, category: string, item?: string) => string
Defines the current language in the user interface. The PE.SDK is shipped with locales for English (
en) and German (
de), but any other language is possible. See Localization for an in-depth explaination of how to add new languages or modify the predefined translations.
Defines the current layout of the user interface. The PE.SDK is shipped with an AdvancedUI (
advanced) and BasicUI (
basic) layout. See UI for more information on their differences.
Set the active theme. The PE.SDK includes predefined
light themes but is also highly customizable to match any style. See Theme for an in-depth explanation of how to create your own theme.
Defines if the ToolBar in the AdvancedUI is position on the left side (
default) or on the right side (
Defines the available buttons of the MainCanvasActionBar and their order. The editor will leave the position empty if
undefined is provided.
Available options are
Defines if the user is able to use the zoom feature.
Defines if the image is scaled to fit the available canvas area.
Set this value to
false to display an image at 100% if it is smaller than the available canvas area.
Bigger images will still be scaled down to fit the canvas area.
Defines if it should be possible to select a smaller zoom level than the default/initial one of the image.
Defines which tools are available and their order. The tools can be grouped in arrays which will be display a separator between the next group.
Defines the tool that is initially loaded. Defaults to
filter in the AdvancedUI or
null in the BasicUI.
Defines if a message is displayed when the image has been scaled down for performance reasons.
Defines if a message is displayed when PE.SDK is exited with unsaved changes.
Defines if a message is displayed when a new image is loaded and changes were made to the image.
If this is set to
false, changes will not be discarded and instead will be applied to the new image.
EditorAPI.reset function can be used to discard changes after loading a new image.
Defines if the title of the tool is displayed in of the ToolControlBar.