phpword

PHPWord in Laravel 5 [closed]

断了今生、忘了曾经 提交于 2019-12-03 03:20:21
Closed . This question needs details or clarity. It is not currently accepting answers. Learn more . Want to improve this question? Add details and clarify the problem by editing this post . I want to use PHPWord on laravel 5 but I cannot find any packages for it. So I decided to add it manually but still I do not have success. I have tried this tutorials and github files: https://github.com/maveius/Laravel-Word http://laravel.io/forum/05-26-2014-how-can-i-export-to-word Also some of it was gone when I just read it yesterday. Please help! Thanks. PHPWord is on Packagist , so installing it on

Download produced file with PHPWord

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use the PHPWord plugin to convert some HTML into .docx But when i download the file, I get only messed up charecters like: Here is my code: <?php error_reporting (E_ALL | E_STRICT); @ini_set ('display_errors', 'on'); require_once '../../../../vendor/autoload.php'; $my_content = $_POST['html_content']; $phpWord = new \PhpOffice\PhpWord\PhpWord(); $section = $phpWord->addSection(); \PhpOffice\PhpWord\Shared\Html::addHtml($section, $my_content); header('Content-Type: application/octet-stream'); header('Content-Disposition:

PHPWord to PDF not able to load library

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have been trying all day to get this to work. Right now I am able to save the document as .docx file but I wanted to be able to save the document as PDF I have tried with DOMPDF and TCPDF but I keep getting error 'Unable to load PDF Library' I confirmed the path is correct. Am I missing something? thank you for your help $rendererName = \PhpOffice\PhpWord\Settings::PDF_RENDERER_TCPDF; $rendererLibrary = 'tcpdf.php'; $rendererLibraryPath = dirname(__FILE__) .'/plugins/tcpdf/' . $rendererLibrary; \PhpOffice\PhpWord\Settings::setPdfRenderer(

PhpOffice\\PhpWord loadTemplate not rendering Word as it should

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have problem with rendering HTML tags when load template. I use HTMLtoOpenXML to render it, but in the end it is just plain code. I use this: $workDescription = $entity->getWorkDescription(); $workDescription = \HTMLtoOpenXML::getInstance()->fromHTML(str_replace("<br />","<br>", stripslashes($workDescription))); $workDescription = $this->replaceSpecialChar($workDescription); $phpWord = new \PhpOffice\PhpWord\PhpWord(); $document = $phpWord->loadTemplate($templatePath); $document->setValue('Description', $workDescription); $document->saveAs

PHPWord export giving Corrupt Word File

匿名 (未验证) 提交于 2019-12-03 01:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I used the example code from PHPWord's site: http://phpword.codeplex.com/documentation And when I try and open it with Word I get the error "The Office Open XML file test.docx cannot be opened because there are problems with the contents." and when I click "Details" It simply says "The file is corrupt and cannot be opened." It does let me repair it and open it, but that wouldn't be very user friendly... Here is the code I'm using: // Create a new PHPWord Object $PHPWord = new PHPWord(); // Every element you want to append to the word

Add chart on phpoffice/phpword

匿名 (未验证) 提交于 2019-12-03 00:59:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I know how to add charts on PHPExcel, but I also need to insert charts on a docx file. Is it possible to manipulate charts with phpoffice/phpword? If it's not possible, do you know a good library for the job? 回答1: It's not actually possible to add chart in a PHPWord Document. But the feature is in the pipe (follow this ticket #123 ). But you can use of one of some libraries used (actually and in the future) by PHPExcel : PHP Charting Libraries . Actually, PHPExcel just use JpGraph for rendering some graphs. 回答2: I don't know the library, but

PHPWord addTOC is not displaying page numbers

杀马特。学长 韩版系。学妹 提交于 2019-12-03 00:44:03
I'm using https://github.com/PHPOffice/PHPWord to generate a word document. The function addTOC generates an index of pages with titles, but for some reason the page numbers do not display. // add table of contents $section->addTOC(); Results in: If I echo the page numbers on the pages where the titles exist, they display fine. But they don't display in the TOC. I checked to confirm the text isn't white. From PHPWord example in samples dir ( https://github.com/PHPOffice/PHPWord/blob/develop/samples/Sample_17_TitleTOC.php ), I would tell it is not possible: echo date('H:i:s'), ' Note: Please

phpword使用

匿名 (未验证) 提交于 2019-12-02 22:11:45
开发文档:http://phpword.readthedocs.io/en/latest/templates-processing.html 使用案例、 https://blog.csdn.net/yellowxiaotian/article/details/20149341 http://www.anttoweb.com/kb/phpword/ 原文:https://www.cnblogs.com/lglblogadd/p/9336733.html

PHPWord to PDF not able to load library

半腔热情 提交于 2019-12-02 01:45:01
I have been trying all day to get this to work. Right now I am able to save the document as .docx file but I wanted to be able to save the document as PDF I have tried with DOMPDF and TCPDF but I keep getting error 'Unable to load PDF Library' I confirmed the path is correct. Am I missing something? thank you for your help $rendererName = \PhpOffice\PhpWord\Settings::PDF_RENDERER_TCPDF; $rendererLibrary = 'tcpdf.php'; $rendererLibraryPath = dirname(__FILE__) .'/plugins/tcpdf/' . $rendererLibrary; \PhpOffice\PhpWord\Settings::setPdfRenderer($rendererName,$rendererLibraryPath); $document->saveAs

PHPword insert table in template

左心房为你撑大大i 提交于 2019-12-01 08:12:19
$PHPWord = new PHPWord(); $section = $PHPWord->createSection(); $table = $section->addTable(); $i = 1; $document = $PHPWord->loadTemplate('/var/sitLims/web/uploads/lmsSyllabus/lmsSyllabus.docx'); $document->setValue('Value1', $course_number); $document->setValue('Value2', $course_name); $document->setValue('Value3', $course_en_name); $document->setValue('Value4', $course_summary); $document->setValue('Value5', $course_purposes); $document->setValue('Value6', $course_content); $document->setValue('Value7', $course_exam); $document->setValue('Value8', $course_description); $document->setValue(