Forum


Replies: 3   Views: 3097
Unable to convert doc to html, docx to html works
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 razasayed  · 18-10-2018 - 15:10

Hello,

Im using the corporate premium version of phpdocx v8.2  which has the conversion capabilities. Im able to convert a docx file to html . However converting doc to html is not working. My code to convert docx to html is like whats given in the sample at https://www.phpdocx.com/documentation/introduction/word-to-html-PHP .

$transformHTMLPlugin = new TransformDocAdvHTMLDefaultPlugin();
$transform = new TransformDocAdvHTML('document.docx');
$html = $transform->transform($transformHTMLPlugin);

If i pass a doc file to TransformDocAdvHTML for example "$transform = new TransformDocAdvHTML('test.doc')", then calling '$transform->transform($transformHTMLPlugin)' gives the following error:

"Exception with message 'Error while trying to open the (base) template as a zip file'"

Can existing doc files be converted to html using phpdocx ?. If yes,i would appreciate some example code to do that.

Thank You