Load design templates into CE.SDK from archive URLs, scene URLs, and serialized strings.
Templates are pre-designed scenes that provide starting points for user projects. CE.SDK supports loading templates from archive URLs with bundled assets, remote scene URLs, or serialized strings stored in files.
This guide covers how to load templates from archives, URLs, and strings, and export the result.
Load from Archive#
Load a template from an archive URL using loadFromArchiveURL(). Archives are .zip files that bundle the scene with all its assets, making them portable and self-contained.
// Load template from archive URL (bundled assets)await engine.scene.loadFromArchiveURL(fashionAdArchiveUrl);Load from URL#
Load a template from a remote .scene file URL using loadFromURL(). The scene file is a JSON-based format that references assets via URLs.
// Load template from a scene URLawait engine.scene.loadFromURL(postcardSceneUrl);Load from String#
For templates stored in databases or files, load from a serialized string using loadFromString().
// Load template from serialized stringawait engine.scene.loadFromString(businessCardSceneString);This method works with content previously saved using engine.scene.saveToString().
Working with the Loaded Scene#
After loading a template, verify the scene loaded correctly and inspect its contents.
Verify the Scene#
Use engine.scene.get() to retrieve the scene block and engine.scene.getPages() to inspect its pages.
// Verify the loaded sceneconst scene = engine.scene.get();if (scene == null) { throw new Error('Failed to load scene');}
const pages = engine.scene.getPages();Cleanup#
Always dispose the engine when finished to release resources.
// Always dispose the engine when doneengine.dispose();