Forum


Replies: 1   Views: 4337
Cannot convert docx to html
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by cubryto  · 14-09-2014 - 03:57

Hi, I'm using phpdocx pro 3.7 on centos 6.5 32 bit with the latest OpenOffice 4.1.0 . When I run the example code (Transform) comes with phpdocx, the example_text.docx was created, but it won't convert to html (or pdf) . I also tried all 4 alternative method that comes with the code. I got the following error: sh: line 1: 2888 Aborted (core dumped) /var/www/html/classes/../lib/OdfConverter/32/OdfConverter /I /tmp/tempDocX_54150f53c1a96.docx /O /tmp/tempOdt_54150f53c259e.odt > /dev/null 2>&1 Thanks P.S: Openoffice headless is running by the command lib/openoffice/openoffice.org3/program/soffice -headless -accept=”socket,host=127.0.0.1,port=8200;urp;” -nofirststartwizard I enabled the debug mode, and here is the log 2014-09-13T21:12:48-07:00 phpdocx_logger INFO Create a temp file to use as initial ZIP file. DOCX is a ZIP file. 2014-09-13T21:12:48-07:00 phpdocx_logger INFO Set language. 2014-09-13T21:12:48-07:00 phpdocx_logger INFO Enable compatibility mode. 2014-09-13T21:12:48-07:00 phpdocx_logger INFO Add text to word document. 2014-09-13T21:12:48-07:00 phpdocx_logger INFO Set DOCX name to: example_text. 2014-09-13T21:12:48-07:00 phpdocx_logger INFO DOCX is a new file, not a template. 2014-09-13T21:12:48-07:00 phpdocx_logger INFO Remove existing template tags. 2014-09-13T21:12:48-07:00 phpdocx_logger INFO Add word/document.xml content to DOCX file. 2014-09-13T21:12:48-07:00 phpdocx_logger INFO Close ZIP file 2014-09-13T21:12:48-07:00 phpdocx_logger INFO Copy DOCX file using a new name. And here is the example code require_once '../../classes/TransformDocAdv.inc'; $docx = new CreateDocx(); $docx->enableCompatibilityMode(); $text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' . 'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' . 'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' . 'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' . 'in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' . 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui ' . 'officia deserunt mollit anim id est laborum.'; $paramsText = array( 'b' => 'single', 'font' => 'Arial' ); $docx->addText($text, $paramsText); $docx->createDocx('example_text'); // using default method $docx->transformDocx('example_text.docx', 'example_text.pdf');