Here is the printPDFPopup function definition:
function printPDFPopup($id_array, $return_contents = false, $send_pdf_to_file = false, $pdf_file_name = "", $restrict_to_user = false)
$return_contents tells the function to return the contents of the PDF as a string instead of outputting it to the browser.
$send_pdf_to_file saves the PDF as a file in the file name specified in $pdf_file_name.
$restrict_to_user will exit the function if the invoice concerned does not belong to the currently logged in user (it is false by default because administrators need to be able to see other people's invoices).
...but I fear we are at the limit of the assistance I can offer on this now, sorry.