combinePDFDocuments output only the first record

path = plugins.file.getDesktopFolder() + "\\output.pdf"
r_pdf = new Array()
var res_pdf;

for (i=0; i<foundset.getSize();i++){
	foundset.setSelectedIndex(i)
	r_pdf.push(foundset.myField)
}

// r_pdf.length tested = 2
res_pdf = plugins.pdf_output.combinePDFDocuments(r_pdf)

var success = plugins.file.writeFile(path, res_pdf)

My foundset size is simply 2, myField is a middle BLOB (<200KB) and the file is succefully written but I found only the first pdf record and not the second…

:(

Any idea?!

Hi axterics,

Foundsets are 1 based, unlike Arrays. So you start counting at 1. So your for-loop should look this this:

for (i=1; i<=foundset.getSize();i++){
	foundset.setSelectedIndex(i)
	r_pdf.push(foundset.myField)
}

Hope this helps.

Gh. SOLVED sorry. :oops:

Thanks ROCLASI