dompdf-通过Safari浏览器下载时,PDF文件损坏

时间:2018-11-12 13:51:03

标签: php safari dompdf

我的代码在Safari之外的其他浏览器中都可以正常工作。我的Safari版本是11.1.2。 Safari浏览器将我的文件重命名为“ invoice.pdf.download”。这是我的代码:

                $dompdf = new Dompdf();
                $dompdf->loadHtml('My transaction details');
                $dompdf->set_option('isRemoteEnabled', TRUE);
                $dompdf->setPaper('A4', 'landscape');
                $dompdf->render();
                $dompdf->stream('invoice.pdf');

以下解决方案不适用于我的情况:

  • 在函数末尾写入exit()/ die()
  • header('Content-Type:application / pdf');

0 个答案:

没有答案
相关问题