我正在使用此代码生成pdf
$base64_pdf = "data:application/pdf;base64,base64encodedpdf".base64_encode($result);
//$base64_pdf = $result;
$pdf_base64_handler = fopen($base64_pdf,\'r\');
$pdf_content = fread ($pdf_base64_handler,filesize($base64_pdf));
fclose ($pdf_base64_handler);
//Decode pdf content
$pdf_decoded = base64_decode ($pdf_content);
//Write data back to pdf file
$pdf = fopen (\'test.pdf\',\'w\');
fwrite ($pdf,$pdf_decoded);
//close output file
fclose ($pdf);
echo $pdf;
var_dump($pdf);
echo \'Done\';
the output now is资源id#617类型(未知)的资源(617)已完成
如何生成pdf并将其保存在库中