Create a new carousel
To create a new carousel, call the createDesign
method and provide a callback function to handle the export data:
editor?.createDesign((data: ExportData) => {
console.log(data);
// You can perform additional operations with the data, such as saving or displaying the carousel
});
Edit an existing carousel
To edit an existing carousel, call the editDesign
method and provide the carousel ID and a callback function to handle the export data:
editor?.editDesign('your-carousel-id', (data: ExportData) => {
console.log(data);
// You can perform additional operations with the data, such as updating the existing carousel
});
Replace your-carousel-id
with the actual ID of the carousel you want to edit.
Understanding the ExportData type
The callback function receives an ExportData object, which contains the following properties:
interface ExportData {
id: string; // Unique identifier for the carousel
name: string; // Name of the carousel
size: string; // Size of the carousel in aspect ratio (e.g., "16:9")
pdf: Blob; // PDF file of the carousel
images: Blob[]; // Array of image files for the carousel
}
You can use the provided data to save, display, or perform any other operations with the carousel.