Word文件(doc)转Pdf转换Usign Php

时间:2019-05-29 11:00:12

标签: php

  

错误:未捕获错误:未找到类“ PHPWord”

  include('PHPWord/src/PhpWord/PhpWord.php');
  $PHPWord = new PHPWord(); 
  $section = $PHPWord->createSection();
  $section->addText('Hello world!');
  header("Cache-Control: public");
  header("Content-Description: File Transfer");
  header("Content-Disposition: attachment; filename=helloWorld.docx");
  header("Content-Type: application/docx");
  header("Content-Transfer-Encoding: binary");
  $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
  $objWriter->save('helloWorld.docx');

0 个答案:

没有答案