PHP Classes

Can't download word document

Recommend this page to a friend!

      VS PHP Word HTML  >  All threads  >  Can't download word document  >  (Un) Subscribe thread alerts  
Subject:Can't download word document
Summary:Can't download word document
Messages:1
Author:Ryan
Date:2016-10-14 20:13:51
 

  1. Can't download word document   Reply   Report abuse  
Picture of Ryan Ryan - 2016-10-14 20:13:51
I want to be able create a word document and download via my browser. How do I do that with this code:

require_once '../src/vsword/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' );