Forum


Replies: 1   Views: 369
Errors in converting from html to word
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 queejie  · 17-01-2019 - 19:36

I am using a trial version to see if the tool works, and it is exiting due to errors.  Is there anything I can do about these?  (I can ignore the warnings, of course, but I left them in for informational purposes. It is the error that kills it that concerns me.)

$docx = new CreateDocx();
$html = file_get_contents($args[0]);
@$docx->embedHTML($html);
@$docx->createDocx('test-html');

Is the error due to the fact that I am using PHP 7.2? The HTML file is valid.

PHP Warning:  Use of undefined constant DEBUGCSS - assumed 'DEBUGCSS' (this will throw an Error in a future version of PHP) in /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php on line 3821
PHP Stack trace:
PHP   1. {main}() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:0
PHP   2. Phalcon\Cli\Console->handle() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
PHP   3. Phalcon\Cli\Dispatcher->dispatch() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
PHP   4. Phalcon\Cli\Dispatcher->callActionMethod() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
PHP   5. TestTask->mainAction() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
PHP   6. CreateDocx->embedHTML() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/app/tasks/TestTask.php:24
PHP   7. HTML2WordML->render() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/CreateDocx.php:4132
PHP   8. HTML2WordML->renderDompdf() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/AutoLoader.php(50) : eval()'d code:648
PHP   9. PARSERHTML->getDompdfTree() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/AutoLoader.php(50) : eval()'d code:674
PHP  10. PARSERHTML->render() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3062
PHP  11. StyleParsersheet->apply_styles() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:2727
PHP  12. StyleParser->inherit() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:5565
PHP  13. StyleParser->__get() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3530
PHP  14. StyleParser->get_font_family() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3790

Warning: Use of undefined constant DEBUGCSS - assumed 'DEBUGCSS' (this will throw an Error in a future version of PHP) in /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php on line 3821

Call Stack:
    0.0005     399488   1. {main}() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:0
    0.3126    5995088   2. Phalcon\Cli\Console->handle() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
    0.3128    5999008   3. Phalcon\Cli\Dispatcher->dispatch() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
    0.3233    7200024   4. Phalcon\Cli\Dispatcher->callActionMethod() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
    0.3233    7200808   5. TestTask->mainAction() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
    0.3611    8327344   6. CreateDocx->embedHTML() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/app/tasks/TestTask.php:24
    0.3655    8924624   7. HTML2WordML->render() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/CreateDocx.php:4132
    0.3655    8924624   8. HTML2WordML->renderDompdf() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/AutoLoader.php(50) : eval()'d code:648
    0.3706    9987680   9. PARSERHTML->getDompdfTree() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/AutoLoader.php(50) : eval()'d code:674
    0.4343   10012256  10. PARSERHTML->render() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3062
    6.4095   12707344  11. StyleParsersheet->apply_styles() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:2727
   12.3806   15111432  12. StyleParser->inherit() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:5565
   12.3807   15112800  13. StyleParser->__get() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3530
   12.3807   15112840  14. StyleParser->get_font_family() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3790

<pre>[get_font_family:(sans-serif.normal.normal.normal.normal)PHP Deprecated:  The each() function is deprecated. This message will be suppressed on further calls in /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php on line 3867
PHP Stack trace:
PHP   1. {main}() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:0
PHP   2. Phalcon\Cli\Console->handle() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
PHP   3. Phalcon\Cli\Dispatcher->dispatch() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
PHP   4. Phalcon\Cli\Dispatcher->callActionMethod() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
PHP   5. TestTask->mainAction() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
PHP   6. CreateDocx->embedHTML() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/app/tasks/TestTask.php:24
PHP   7. HTML2WordML->render() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/CreateDocx.php:4132
PHP   8. HTML2WordML->renderDompdf() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/AutoLoader.php(50) : eval()'d code:648
PHP   9. PARSERHTML->getDompdfTree() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/AutoLoader.php(50) : eval()'d code:674
PHP  10. PARSERHTML->render() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3062
PHP  11. StyleParsersheet->apply_styles() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:2727
PHP  12. StyleParser->inherit() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:5565
PHP  13. StyleParser->__get() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3530
PHP  14. StyleParser->get_font_family() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3790
PHP  15. each() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3867

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php on line 3867

Call Stack:
    0.0005     399488   1. {main}() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:0
    0.3126    5995088   2. Phalcon\Cli\Console->handle() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
    0.3128    5999008   3. Phalcon\Cli\Dispatcher->dispatch() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
    0.3233    7200024   4. Phalcon\Cli\Dispatcher->callActionMethod() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
    0.3233    7200808   5. TestTask->mainAction() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
    0.3611    8327344   6. CreateDocx->embedHTML() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/app/tasks/TestTask.php:24
    0.3655    8924624   7. HTML2WordML->render() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/CreateDocx.php:4132
    0.3655    8924624   8. HTML2WordML->renderDompdf() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/AutoLoader.php(50) : eval()'d code:648
    0.3706    9987680   9. PARSERHTML->getDompdfTree() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/AutoLoader.php(50) : eval()'d code:674
    0.4343   10012256  10. PARSERHTML->render() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3062
    6.4095   12707344  11. StyleParsersheet->apply_styles() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:2727
   12.3806   15111432  12. StyleParser->inherit() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:5565
   12.3807   15112800  13. StyleParser->__get() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3530
   12.3807   15112840  14. StyleParser->get_font_family() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3790
   12.3814   15113272  15. each() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3867

(sans-serif)PHP Fatal error:  Uncaught Error: Class 'Font_Metrics' not found in /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3872
Stack trace:
#0 /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php(3790): StyleParser->get_font_family()
#1 /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php(3530): StyleParser->__get('font_family')
#2 /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php(5565): StyleParser->inherit(Object(StyleParser))
#3 /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php(2727): StyleParsersheet->apply_styles(Object(FrameParser_Tree))
#4 /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php(3062): PARSERHTML->render('*')
#5 /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/AutoLoader.php(50) : eval()'d code(674): PARSERHTML->getDompdfTree('<!DOCTYPE html>...', false, '*', false, '')
#6 /Users in /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php on line 3872

Fatal error: Uncaught Error: Class 'Font_Metrics' not found in /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php on line 3872

Error: Class 'Font_Metrics' not found in /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php on line 3872

Call Stack:
    0.0005     399488   1. {main}() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:0
    0.3126    5995088   2. Phalcon\Cli\Console->handle() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
    0.3128    5999008   3. Phalcon\Cli\Dispatcher->dispatch() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
    0.3233    7200024   4. Phalcon\Cli\Dispatcher->callActionMethod() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
    0.3233    7200808   5. TestTask->mainAction() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/bin/runTask:44
    0.3611    8327344   6. CreateDocx->embedHTML() /Users/dqj/dev/pls3rdl/pl3/nocti/backend/app/tasks/TestTask.php:24
    0.3655    8924624   7. HTML2WordML->render() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/CreateDocx.php:4132
    0.3655    8924624   8. HTML2WordML->renderDompdf() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/AutoLoader.php(50) : eval()'d code:648
    0.3706    9987680   9. PARSERHTML->getDompdfTree() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/AutoLoader.php(50) : eval()'d code:674
    0.4343   10012256  10. PARSERHTML->render() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3062
    6.4095   12707344  11. StyleParsersheet->apply_styles() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:2727
   12.3806   15111432  12. StyleParser->inherit() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:5565
   12.3807   15112800  13. StyleParser->__get() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3530
   12.3807   15112840  14. StyleParser->get_font_family() /Users/dqj/dev/pls3rdl/pl3/phang/vendor/phpdocx-trial-basic-8.5/classes/DOMPDF_lib.php:3790