mPDF错误:无法创建输出文件:cache/InInvoice.pdf


mPDF error: Unable to create output file: cache/Invoice.pdf

我在vtiger crm 上遇到一个问题

错误消息为:
mPDF错误:无法创建输出文件:cache/VInvoice.pdf

case 'F':
        //Save to local file
        $f=fopen($name,'wb');
        if(!$f) $this->Error('Unable to create output file: '.$name);
        fwrite($f,$this->buffer,strlen($this->buffer));
        fclose($f);
        break;

检查您是否有创建文件的权限。尝试指定完整路径直到文件,如$fileName = "/var/app/public_html/cache/Invoice.pdf"

为什么要用PHP的方式保存mPDF生成的文件?为什么不使用Output($fileName, $destinationType)

$mpdf=new mPDF();
$mpdf->WriteHTML('<p>Hallo World</p>');
$mpdf->Output($fileName, 'D');

文件。

确保运行脚本时,文件cache/VInvoice.pdf未在任何位置打开。如果它在其他地方打开,则TCPDF无法打开它。