php - 获取最新版本的 mPDF (7.1) 以使用 phpExcel?
问题描述
我将 mPDF v5.7.4 与 phpExcel 一起使用,它可以工作,但这似乎是开箱即用兼容的新版 mPDF。
我将 mPDF 包含在这些行中:
$rendererName = PHPExcel_Settings::PDF_RENDERER_MPDF;
$rendererLibraryPath = dirname(__FILE__) . '/mpdf';
if (!PHPExcel_Settings::setPdfRenderer(
$rendererName,
$rendererLibraryPath
)) {
die(
'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
'<br />' .
'at the top of this script as appropriate for your directory structure'
);
}
// Redirect output to a client’s web browser (PDF)
header('Content-Type: application/pdf');
header('Content-Disposition: attachment;filename="pdf.pdf"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'PDF'); // $objPHPExcel is set before this whole code block
$objWriter->save('php://output');
但是最新版本(7.1)具有不同的文件结构,如果可能的话,我无法弄清楚如何包含它。有任何想法吗?
5.7.4 文件结构:
7.1 文件结构:
解决方案
推荐阅读
- excel - VBA计算Excel两个数组之间的绝对差异
- javascript - 我可以使用 detox 测试框架来测试 react + react 原生应用吗?
- php - Yii2 Facebook oauth - 违反完整性约束:1048 - 列“电子邮件”不能为空
- java - 转换 JavaObject `scala.collection.Map
- syntax - 为什么OCaml中有这么多表达式终止符?
- sas - 如何在 SAS 中创建动态字符串?
- json - 如何解析具有嵌套模式的 json?
- mysql - 我想从 SQL 中的表中更新数量,从检查 MIN(ExpDate) 和条形码
- sql - SQL 使用 WHERE LIKE 选择 DISTINCT
- php - 无法从 php 中的任何 HTTP 请求中获取参数