okay... i've found the bug!
Here's what was basicly wrong...
$content .=
ob_get_clean(); // add the content for the first document
ob_get_clean() > Get current buffer contents and delete current output buffer, so it's not available for the next part > $content_print
So, after replacing this with
ob_get_contents(), it runs smoothly.
$content_print .= ob_get_clean(); // add the content for the second document and now delete the output buffer
ob_end_clean();
Secondly, i've found out that i need to use the complete script (as used for the first file) again for the second one, so the last part should be this:
try {
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->pdf->SetAuthor($_SESSION['user']);
$html2pdf->pdf->SetTitle($TITEL);
$html2pdf->pdf->SetSubject('Factuur');
$html2pdf->pdf->SetKeywords($DOCUMENTNR, $TITEL);
$html2pdf->pdf->SetDisplayMode('fullpage'); */
$html2pdf->writeHTML($content);
// save the first document to the given filelocation
$html2pdf->Output($filelocation.$file_name, 'F');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->pdf->SetAuthor($_SESSION['user']);
$html2pdf->pdf->SetTitle($TITEL);
$html2pdf->pdf->SetSubject('Factuur');
$html2pdf->pdf->SetKeywords($DOCUMENTNR, $TITEL);
$html2pdf->pdf->SetDisplayMode('fullpage'); */
$html2pdf->writeHTML($content_print);
// save the second document to the given (different) filelocation
$html2pdf->Output($filelocation_print.$file_name, 'F');
}
Basicly the first mistake caused the err05 because there is an unclosed <page tage since that is closed in the content used for both files!
The second one is just a matter of knowing that the created $html2pdf array is being cleared after creating a PDF.
Thanks for reading anyway!