Remove Banner Page with Output Preset Script

Can we remove a banner page that is part of a template by using an Output Preset script?

Hello @Finny81,

I assume that you are referring to the feature which you can enable in the Advanced Print Wizard or in an Output Preset and that you don’t meant a Print Section by, and I quote, “a banner page that is part of a template”, is that right?

Can you also let us know please in what kind of situation you would like to be able to do so?

*See the webpage Banner pages - OL Connect 2024.1 Help for more information about this feature.

Elaborating on this… We have two sections in the document (Template), one is the physical document (section1) and one is the banner page (section2). As part of an Output Preset that creates a PDF, we only want to print section1.

Would it not be better to enable/disable Print Section “section2” when a certain condition is met on the Print Template side? Is there a reason why you would like to do this by a Output Preset?

On the Print Template side this can be achieved by applying a script like the following one:

Control Script

Name: Example

var section = merge.template.contexts.PRINT.sections["section2"];
var field = "";

if (!section) {
	throw "'section2' not found";
}

field = record.fields.fieldName;

section.enabled = true;

if (field !== "" && field === "hide section") {
	section.enabled = false;
}

We agreed with you and did it your way. We have a very weird issue now. We literally did save as to form a set of three files and the banner page only works on the original file now. Doesn’t appear on the other two files. We have the same issue on another set of two that go together too. Can you provide us with a set of code that will make them reappear. Our current script:

var section = merge.template.contexts.PRINT.sections[‘BannerPage’];
if (!section) {
throw “‘BannerPage’ not found”;
}
if (record.index == 1 ) {
section.enabled = true;
} else {
section.enabled = false;
}