Use a control script to clone the section as many times as there are records in the detail table
Apply a dynamic pdf background to each clone.
Below is the control script.
var printSections = merge.template.contexts.PRINT.sections;
merge.template.contexts.PRINT.sections[“Section 1”].enabled = false;
var numClones = record.tables[‘detail’].length;
var rootFolder= record.fields.rootFolder; //C://OLForums//156223//
var subDir= record.fields.CaseNo;
var pdfName;
for( var i = 0; i < numClones; i++){
pdfName= record.tables.detail[i].fields.pdfName;
addBackground(pdfName);
}