我正在尝试使用PHPPowerpoint和他的示例
但我得到以下错误:
*Sample 01 Complex
14:56:03 Create new PHPPresentation object
14:56:03 Set properties
14:56:03 Remove first slide
14:56:03 Create templated slide
14:56:03 Create a shape (rich text)
14:56:03 Create templated slide
14:56:03 Create a shape (rich text)
14:56:03 Create a shape (rich text)
14:56:03 Create templated slide
14:56:03 Create a shape (rich text)
14:56:03 Create a shape (rich text)
14:56:03 Create templated slide
14:56:03 Create a shape (rich text)
14:56:03 Create a shape (rich text)
**Fatal error: Class 'Common\XMLWriter' not found in .....\test phppowerpoint\PHPPowerPoint-develop\src\PhpPresentation\Writer\PowerPoint2007\AbstractPart.php on line 76***有人能帮我修复这个错误吗?谢谢
发布于 2015-07-23 09:07:22
您正面临此问题,因为common office php文件丢失。下载:
https://github.com/PHPOffice/Common
并将其包含在源代码中(在更新路径之后):
require_once 'Common-develop/src/Common/Autoloader.php';
\PhpOffice\Common\Autoloader::register();发布于 2016-01-28 04:40:26
正如Raj所说,您需要从他指定的链接下载公共PHPOffice类。你可以把它们放在对你更方便的地方。在我的例子中,我将Common文件夹放在了src文件夹中(所以在src中你会有PHPPresentation和Common)。然后,您需要像Raj所说的那样,将它们包含在源代码中
require_once 'PHPPresentation/src/Common/Autoloader.php;
\PhpOffice\Common\Autoloader::register();您必须将require_once中的路径更新为您的实际路径。
附言:不要忘记目标文件夹的写权限,否则库将无法写出演示文稿文件!
https://stackoverflow.com/questions/31541595
复制相似问题