openLogoUpload() / openLogoGallery() open only the logo dialog. The uploaded or picked logo becomes the
customer's selected logo and the logo / selected event fires.getLogo(), setLogo(guid) and clearLogo() read and change the selected logo. It is used as the default logo
of the next print job and by logo visualizations.printJob.logo (or a logo per printing) preselects a logo by guid or url. A GUID must belong to a logo of
the current customer in the same TronDesigner environment - this page therefore uses the logo you select in the gallery.No logo selected
const td = window.tronDesigner;
// Remember the logo the customer selects or uploads (entityGuid is null when the selection was cleared)
td.subscribeDesignerEvent('logo', 'selected', (event) => {
selectedLogoGuid = event.entityGuid;
});
// Only the logo dialog
td.openLogoGallery({ mode: 'dialog' }); // or td.openLogoUpload({ mode: 'dialog' })
// The current selected logo
const logo = await td.getLogo(); // ILogoDTO or undefined
console.log(logo?.logoGuid);
// Preselect a logo in a new print job - by GUID or by URL
td.openDesigner({
openMode: 'Create',
dataMode: 'Exact',
printJob: {
logo: { guid: selectedLogoGuid }, // or { url: 'https://www.promotron.com/media/brand/tronshop/horizontal-color.svg' }
addProducts: { supplierCode: 'PFC', variants: [{ productCode: '10086021' }] },
addPrintings: [{ printPositionCode: 'front', printTechnologyCode: 'PAD03' }]
}
}, { mode: 'dialog' });