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;