Dynamic Background via Automation variable

I have the name of a PDF to use as the Background Image for a Print Section stored in an Automation property.

When I go to the Background Tab of the Print Section properties page, I tried the following:

file:///C:/Users/tdgreer/Desktop/Postcards/${automation.variables.BackgroundImage}

I only get a red β€œX”.

Does Connect not support Dynamic Background Images through the GUI?

Workflow Process variables are not supported in the Designer yet (they are supported in the DataMapper). Store your PDF name in a JobInfo instead.

Hello Phil,

I could create a field in datamaper and store the pdf file name and path as the value. Then how could I load it to the template as the background?

I do see the From PDF DataMaoper input on the Print Section Properties popup, but not sure how to do it.

Thanks,

John

Use a Control Script. Build a variable that constructs the path to the PDF, including whatever field from the data model you need. Here’s part of a Control Script I wrote to enable different print sections and then set the background dynamically.

// build full path to background image
var prefix = "file:///";
var imgBackground = record.fields.imgBackground;
var resourcePath = prefix + imgBackground;

// set background image of enabled print section
enabledSection.background.source = BackgroundResource.RESOURCE_PDF;
enabledSection.background.url = resourcePath;

FYI. In OL Connect Designer 2019.2 we are introducing a script wizard to simplify setting dynamic section backgrounds.

Erik

1 Like