PHP Classes

Errors

Recommend this page to a friend!

      PHP Parse DOCX to HTML with Images  >  All threads  >  Errors  >  (Un) Subscribe thread alerts  
Subject:Errors
Summary:getting multiple error when running on PHP 7.3.7
Messages:6
Author:Pascal Böttcher
Date:2021-10-15 06:35:18
 

  1. Errors   Reply   Report abuse  
Picture of Pascal Böttcher Pascal Böttcher - 2021-10-15 06:35:18
Hi, nice work. I tried to get this running, but am getting a lot of errors.

Notice: Undefined variable: Rstyle in C:\inetpub\wwwroot\docxtohtml\wordphp.php on line 333

Notice: Undefined variable: FontTheme in C:\inetpub\wwwroot\docxtohtml\wordphp.php on line 334

Notice: Undefined variable: FontTheme in C:\inetpub\wwwroot\docxtohtml\wordphp.php on line 336

Fatal error: Uncaught ArgumentCountError: Too few arguments to function WordPHP::findstyles(), 0 passed in C:\inetpub\wwwroot\docxtohtml\wordphp.php on line 500 and exactly 1 expected in C:\inetpub\wwwroot\docxtohtml\wordphp.php:199 Stack trace: #0 C:\inetpub\wwwroot\docxtohtml\wordphp.php(500): WordPHP->findstyles() #1 C:\inetpub\wwwroot\docxtohtml\wordphp.php(923): WordPHP->getListFormating(Object(XMLReader), '') #2 C:\inetpub\wwwroot\docxtohtml\wordphp.php(1626): WordPHP->getParagraph(Object(XMLReader), '', '', '') #3 C:\inetpub\wwwroot\docxtohtml\test.php(4): WordPHP->readDocument('sample.docx', '') #4 {main} thrown in C:\inetpub\wwwroot\docxtohtml\wordphp.php on line 199

Can you have a look at that.

  2. Re: Errors   Reply   Report abuse  
Picture of Timothy Edwards Timothy Edwards - 2021-10-15 07:51:06 - In reply to message 1 from Pascal Böttcher
Thanks for your message. Will investigate the problem and get back to you. I forgot that the environment I was testing it under was only php 5.6.

  3. Re: Errors   Reply   Report abuse  
Picture of chris edeling chris edeling - 2021-10-15 08:33:27 - In reply to message 2 from Timothy Edwards
Nice idea but also waiting for PHP 7 version
When testing on PHP 5.6 it provided output, but paragraph numbering was incorrect and footnotes were ignored. Let me know if I should post or email you my .docx document and the resulting html

Regards

Chris

  4. Re: Errors   Reply   Report abuse  
Picture of Timothy Edwards Timothy Edwards - 2021-10-15 19:41:06 - In reply to message 1 from Pascal Böttcher
I have now updated the class so that it will run under php 7.3.

Note that there is a small change to the statement required to run the class in the default mode:-
$text = $rt->readDocument('FILENAME');
changes to
$text = $rt->readDocument('FILENAME','NN');

Not been able yet to test under php 7.4 due to a problem which I have raised with my web host.

  5. Re: Errors   Reply   Report abuse  
Picture of Timothy Edwards Timothy Edwards - 2021-10-15 19:55:59 - In reply to message 3 from chris edeling
Chris,
As noted in my previous post, it will now run under (at least) 7.3.

Regarding your issues, please send me your word document etc, and I will investigate them. Email is fine. Can you send them to me or do I have to make my email address more public? I would however say that I have not yet implemented footnotes (as none of my test documents had them). That is something that I will now look into and rectify.

In producing this class, I found that I had to test it using a variety of Word documents from different sources, as what worked with one document, did not necessarily work correctly with another. One of the reasons is that due to the complexity of the various XML documents which make up a DOCX file, there is more that one way in doing many things.

  6. Re: Errors   Reply   Report abuse  
Picture of chris edeling chris edeling - 2021-10-16 01:05:53 - In reply to message 5 from Timothy Edwards
Timothy please email me at cedeling@gmail.com cos I cant find your email address
Chris