PHP Classes

VsWord not working for me

Recommend this page to a friend!

      VS PHP Word HTML  >  All threads  >  VsWord not working for me  >  (Un) Subscribe thread alerts  
Subject:VsWord not working for me
Summary:Its throwing an error
Messages:2
Author:Rahul Maurya
Date:2016-09-27 08:04:28
 

  1. VsWord not working for me   Reply   Report abuse  
Picture of Rahul Maurya Rahul Maurya - 2016-09-27 08:04:28
hi,
i have unzipped the vsword package placed it inside localhost/xampp/htdocs. create a file and copied the example what you have given
<?php

require_once 'vsword/VsWord.php';

VsWord::autoLoad();

$doc = new VsWord();
$parser = new HtmlParser($doc);
$parser->parse( '<h1>Hello world!</h1>' );
$parser->parse( '<h3>Hello world!</h3>' );
$parser->parse( '<p>Hello world!</p>' );
$parser->parse( '<h2>Header table</h2> <table> <tr><td>Coll 1</td><td>Coll 2</td></tr> </table>' );
$parser->parse( $html );

echo '<pre>'.($doc->getDocument() -> getBody() -> look()).'</pre>';

$doc->saveAs( 'htmlparser.docx' );

?>
now after running that particular file its throwing error like

Notice: Undefined variable: html in C:\xampp\htdocs\examp.php on line 13

BodyCompositeNode
EmptyCompositeNode
PCompositeNode
PPrCompositeNode
RCompositeNode
RPrCompositeNode
BoldStyleNode
FontSizeStyleNode
TextNode
RCompositeNode
EmptyCompositeNode
PCompositeNode
PPrCompositeNode
RCompositeNode
RPrCompositeNode
BoldStyleNode
FontSizeStyleNode
TextNode
RCompositeNode
EmptyCompositeNode
PCompositeNode
PPrCompositeNode
RCompositeNode
TextNode
RCompositeNode
EmptyCompositeNode
PCompositeNode
PPrCompositeNode
RCompositeNode
RPrCompositeNode
BoldStyleNode
FontSizeStyleNode
TextNode
RCompositeNode
TableCompositeNode
TableRowCompositeNode
TableColCompositeNode
PCompositeNode
PPrCompositeNode
RCompositeNode
TextNode
RCompositeNode
TableColCompositeNode
PCompositeNode
PPrCompositeNode
RCompositeNode
TextNode
RCompositeNode
EmptyCompositeNode

  2. Re: VsWord not working for me   Reply   Report abuse  
Picture of Raskin Veniamin Raskin Veniamin - 2016-09-27 12:19:55 - In reply to message 1 from Rahul Maurya
Hi.
Check you code, variable HTML not found