Can anybody help i’m a bit stranded here.
For input to PP Connect datamapper/designer I use a XML file - which gives me X number of records.
Each record holds a Pagelayout and a path for a background pdf file o nthe harddrive.
Now i need Designer to place:
Page 1 from the pdf file located on a harddrive as a background on the same page where record 1 is,
Page 2 from the pdf file located on a harddrive as a background on the same page where record 2 is,
etc.
The PDF page on the harddrive always has the same number og pages as there is records in the xml fil.
Tried the script below - but it is not working as expected.
If the XML has 9 records the PDF has 9 records. The script gives me 9 x 9 pages = 81 pages - only wanted 9 pages
Any hints ?
Tried this script:
var section = merge.template.contexts.PRINT.sections[‘A4_Portrait’];
var prefix = "file:///";
var filePath = record.fields.Background;
var resourceURL = prefix + filePath;
section.background.source = BackgroundResource.RESOURCE_PDF;
section.background.url = resourceURL;
section.background.position = MediaPosition.FIT_TO_MEDIA;
section.background.allPages = true;
section.enabled = true;
Now this would work if I made a split on the background pdf file into single pages before and wrote the single pages into the records with different names. But there must be an easyer way than doing this split pdf before.