I want to set a variable background pdf for the frontside and a seperate variable background pdf for the backside.
Example
I have a lot of single page pdfs as internal resource in the Connect Designer. I have a record field with the information which pdf should be set as background for frontside and which should be set as background for backside.
record
Frontside pdf
Backside pdf
1
01.pdf
02.pdf
2
03.pdf
02.pdf
3
01.pdf
04.pdf
4
...
...
Is it possible to do that without using Workflow and without creating double page pdfs for every possible constellation?
I would prefer to set a print section per single pdf (eg. section1 = 01.pdf, section2 = 02.pdf, …), make the sections conditional and set a global duplex command for output.
One way to do this would be to add an image on each MasterPage (front and back). Then using a script, change the image “src”(source) tag value. Giving an ID to each image placeholder would make it easier to use a script with only a Selector.
Global duplex isn’t currently available but has been raised as a featue request. You could setup a print queue which automatically prints duplex anything it receives.
As far as setting one section per side, there are several ways to achieve. One would be to use the control script below where Front and Back are the names of the front and reverse page sections respectively:
let frontBackground = merge.template.contexts.PRINT.sections.Front.background;
let backBackground = merge.template.contexts.PRINT.sections.Back.background;
frontBackground.source = BackgroundResource.RESOURCE_PDF;
backBackground.source = BackgroundResource.RESOURCE_PDF;
let resourceUrlFront = 'images/' + record.fields.FrontSidePDF;
let reourceUrlBack = 'images/' + record.fields.BackSidePDF;
frontBackground.url = resourceUrlFront;
backBackground.url = reourceUrlBack;
[Example Template ](https://learn.objectiflune.com/qa-blobs/15454468316193301638.zip)
Thank you for your reply. Thats the best approach for my purposes, because its pretty easy to realize for an unexperienced user. But instead of using a script I simply use the Dynamic-Image-Function to replace the background-image (pdf).
Just to clear out any confusion, the example doesn’t require the use of Workflow if you don’t need to. The above script is a control script in the Designer and gives yo a lot of flexibility such as positioning the image (not necessarily at 0, 0 coordinates) and setting the start and end page indexes of your background (in case you have for instance multi-page PDF images and you wanted to only use a specific page). More information here:
Thats right, but theres no duplex command in my generated postscript. So I have to use Workflow to print it in duplex mode or have to configurate a printer queue in the rip. But if I want to send the generated postscript e.g. to another company the postscript doesn`t contain the duplex command.
It’s exactly what I have been looking for. In my case, I have dynamic pdfs with variable number of pages and the page which should be used for background is also dynamic but can be at landscape orientation. Is it possible to rotate the background?