You can't use that function to Merge a PDF to a blank PDF.
One way round that is to export the first portal row as a PDF and then merge from the second time through, so
If(counter = 1)
// just export, no processing
Other way is to use another function to take your final output and create anew file from just a range of pages ( in your case 2..n) - this is called splitting, there might be a function to do that at the FMForums ScriptMaster forum (I have written quite a few of them)
If you use MBS Plugin, you could use the PDF functions there.
Either PDFKit for Mac only or DynaPDF for cross platform.
Thanks jrenfrew I'll have a go as you suggest and let you know how I go....
works a dream
sorry but i don't understand why you have omit the "else" in the if...end if, and what is the values of $counter to the first loop on
if($counter = 1)
export field contents[..., $Path]
Using the else step seemed to cause an endless loop of exporting field contents and I had to force quit. I then opted for "if" and "end if" as it seemed a definite way to say - if this is the first line of the portal - do this - if it is not the first line of the portal - do this.
$counter (as I understand it) is simply a way to indicate which portal row you are working with. It returns 1, 2, 3, 4 etc. You set the portal row amount in the earlier variable which gives you the exit loop point.
The above seems to work ok for me but I'm sure others may have additional info....