【发布时间】:2020-04-13 08:28:47
【问题描述】:
我已尝试阅读 .docx 文件。我成功阅读了 .docx 文件。但我必须用 PHPWord 阅读 .pdf 文件。
知道我该怎么做吗?
我已经尝试过代码
// Read contents
$source = "./example.pdf";
$phpWord = \PhpOffice\PhpWord\IOFactory::load($source, 'Word2007');
$data = '';
$section = $phpWord->addSection();
$section->addText($data);
$name = "officefile";
$source = __DIR__ . "/results/{$name}.html";
// Saving the document as HTML file...
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'HTML');
$objWriter->save($source);
【问题讨论】: