PHP Classes

"Align" styling is not working while generating from Html Parser

Recommend this page to a friend!

      PHP Classes blog  >  Create Microsoft Word...  >  All threads  >  "Align" styling is not working while...  >  (Un) Subscribe thread alerts  
Subject:"Align" styling is not working while...
Summary:"Align" styling is not working while generating from Html Parser
Messages:1
Author:Abhay Pai
Date:2017-03-15 11:06:22
Update:2017-03-15 11:07:38
 

  1. "Align" styling is not working while...   Reply   Report abuse  
Picture of Abhay Pai Abhay Pai - 2017-03-15 11:07:38
Below is my testing code from the examples


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>' );

$html = '<p align="right">Some more text ... More text about... Some more text ... More text about... Some more text ... More text about...</p>';

$html .= '<p align="left">Some more text ... More text about... Some more text ... More text about... Some more text ... More text about...</p>';

$html .= '<p align="center">Some more text ... More text about... Some more text ... More text about... Some more text ... More text about...</p>';

$html .= '<p align"justify">Some more text ... More text about... Some more text ... More text about... Some more text ... More text about...</p>';

$parser->parse($html);

$doc->saveAs( 'doc-created/test.doc' );