Hello,
From a control script, Iām sure this is possible, but is there some setting or check box that will also do this in Connect Designer for a section that uses a dynamic image?
Feature request if not
thanks!
Lou Pace
Hello,
From a control script, Iām sure this is possible, but is there some setting or check box that will also do this in Connect Designer for a section that uses a dynamic image?
Feature request if not
thanks!
Lou Pace
Use the resource() method in your control script to check for the existence of the dynamic images and then enable the relevant sections and apply their corresponding background images (no checkbox currently exists for this):
let section = merge.template.contexts.PRINT.sections['Section 1'];
let currentBackgroundImage = record.fields.imagesPath + record.fields.backgroundImg; //Ex: c:/images/test.jpg
section.enabled = false;
if (!section) {
throw "'Section 1' not found";
}
if (resource(currentBackgroundImage)) {
section.enabled = true;
section.background.source = BackgroundResource.RESOURCE_PDF;
section.background.url = 'file:///' + currentBackgroundImage.replace(/\s/g, '%20');
}
Rod, if my template has a div that uses a background image instead of the section, can I still do the same and raise an error/ not print the section?
end user wants a notification if their document is missing an image.