sorry, not trying to do php code from within a pdf, but trying to use the code in php pdf stuff (before closing the pdf file "pdf_delete")
thanks for pointing me in the right direction solved the problem with
$localfile = fopen ("/$pdf_naam.pdf", "r+");
fwrite($localfile, $buf);
fclose($localfile);
this seems to overwrite the file, but i have to create it first, now looking to see if i can create the file on demand, with a unic name "$pdf_naam"