Change simplex/duplex fast

What is the fastest way to change simplex/duplex output from workflow/datamapper variable:

  • using two sections switching in a control script, one duplex, one simplex?
  • changing the merge.context.sections.SectionName.sheetConfig.duplex value?

Input file of workflow/datamapper is a pdf named 3_S_test.pdf.
Output in Designer is the PDF Ressource of Datamapper.

the first variable (automation.properties.OriginalFilename.split(“_”)[0] stands for the number of pages of each document driving the boundaries script. This works.

But how can I change simplex/duplex the fastest way by using the second variable automation.properties.OriginalFilename.split(“_”)[1] (in this case S for Simplex, D for Duplex)

Edit: The fastest way may be creating 2 workflows, one for simplex, one for duplex jobs. But I‘m still curious if there‘s an idea to keep the number of workflows low.

Thx,

Ralf

Hello @RalfG,

Depending on how many Print Sections your Template currently contain and which Sheet Configuration settings are currently applied to each Print Section, you can apply a Control Script like the following one within your Template to achieve this:

Control Script

Name: Example

const section = merge.template.contexts.PRINT.sections["Section 1"];
const parts = automation.properties.OriginalFilename.split("_");
const mode = parts.length > 1 ? parts[1] : "";

if (mode === "S") {
	section.sheetConfig.duplex = false;
} else if (mode === "D") {
	section.sheetConfig.duplex = true;
}

Tip: See sheetConfig - OL Connect 2024.1 Help for more information about the sheetConfig object

Marten,

thx, already solved it the dirty way:

var Section = merge.context.sections.Sheet;
(automation.properties.OriginalFilename.split("_")[1] == "S") ? Section.sheetConfig.duplex = false : Section.sheetConfig.duplex = true;

Now, I’ll try the speed differences…

Ralf.

When you’re sure that automation.properties.OriginalFilename.split("_") always returns an array with at least two values then I would recommend to change your JavaScript code to the following instead:

const section = merge.template.contexts.PRINT.sections["Section 1"];

section.sheetConfig.duplex = automation.properties.OriginalFilename.split("_")[1] === "D";