I am building a Connect package that uses page programming information taken from a CSV input to dynamically present pages in an associated PDF which - in turn - generates a postscript file to drive the printer’s behaviour (including media/tray calls and duplexing).
Each record in the CSV represents a page. As an example, here’s a simplified sample of how the records look:
page, plex, selectSide, mediaSize, mediaSource, mediaName
1, “S”, “”, “A4”, “1”, “Default”
2, “D”, “Front”, “A4”, “1”, “Default”
3, “D”, “Next”, “A4”, “1”, “Default”
4, “D”, “Front”, “A4”, “1”, “Default”
5, “D”, “Front”, “A4”, “1”, “Default”
6, “D”, “Next”, “A4”, “1”, “Default”
7, “D”, “Next”, “A4”, “1”, “Default”
8, “D”, “Next”, “A4”, “1”, “Default”
The fields are defined as:
page: points to a page in the associated PDF
plex: “S” = Simplex, “D” = Duplex, “DL” = Duplex-Long Edge, “DS” = Duplex-Short Edge
selectSide: “Front” = Force this page onto front side, “Next” run this page on whatever side is next
mediaSize: media size
mediaSource: tray number
mediaName: media name
My template is sparse:
- Each supported page size has an empty media definition and an empty print section
A control script performs the following tasks:
Read the record
Enable only the required Print Context
Apply the background from the pdf based on page
Conditionally set the section’s duplex value based on plex
I’ve built out a Job Preset and an Output Preset based on the ppd for the target printer. I am getting what appears to be the right postscript instructions in the output file - albeit I won’t know if it works until I fire it at the hardware!
The sticking point now is how to force the front side? As shown in my example above, the page instructions can sometimes present records where duplex is still enabled, but the page must be forced to the front side rather than the next side. The output would be similar to simplex in this scenario.
It seems to me the “proper” way to do this would be by using separation which will implicitly force the printer to start on a new sheet. It also adds the option of throwing a ‘jog’ command which would give us separation in the output stack.
I’ve not really played much with this end of the product, but after looking at the options available to me in the Print Preset, it seems I can force separation by document. This in turn would require the Job Preset to define the boundaries of a document. At this point I can’t see how to obviously do this in the interface for the Job Preset. I need to force a new document boundary when plex=“D” and selectSide=“Front”.
Currently my fallback option is to read ahead to the next record within my control script and conditionally set AllowContent.FRONT_ONLY for the current sheet when my condition is met.
That said, it would be nice to see if this could be done purely using the job/output presets as I feel that’s a cleaner approach.