This function extends pdf_fillinfields_merge to be able to use an array of JSON Data, then it merges the pdf's into one file. Works in builds 4346-4889 and higher.

function pdf_fillinfields_merge_multiple as l (pdfFileIn as c, pdfFileOut as c, JSONData as c)
	dim data as p = json_parse(JSONData)
	dim temp_folder as c = a5_create_tempfoldername()+chr(92)
	dim temp_file as c = remspecial(*guid_create())+chr(45)
	dim all_files as c = ""
	for i = 1 to data.size()
		dim file as c = temp_folder+temp_file+i+".pdf"
		all_files = all_files + file +crlf()
		if .not. pdf_fillinfields_merge(pdfFileIn,file,json_generate(data[i])) then
			pdf_fillinfields_merge_multiple = .f.
		end if	

	'Now that we have data.size() pdf's we want to merge them using pdfFileOut
	if .not. pdf_append_list(all_files,pdfFileOut) then
		pdf_fillinfields_merge_multiple = .f.
	end if
	pdf_fillinfields_merge_multiple = .t.
end function