
jack smith - 2016-06-28 13:16:32 -
In reply to message 4 from Raskin Veniamin
Hi,
I have tried according to your instruction, But it output nothing in Doc file.
Here is my code
<?php
require_once '../vsword/VsWord.php';
VsWord::autoLoad();
$doc = new VsWord();
$parser = new HtmlParser($doc);
class MyInitNode implements IInitNode {
function initNode($tagName, $attributes) {
if($tagName == 'input' && isset($attributes['type']) && $attributes['type'] == 'checkbox') {
$p = new PCompositeNode();
//return this any your object
//this parser handler tag from html and return analog docx
return $p;
}
}
}
$html = '<input type="checkbox"/>';
$parser->addHandlerInitNode( new MyInitNode() );
$parser->parse($html);
echo '<pre>'.($doc->getDocument()->getBody()->look()).'</pre>';
$doc->saveAs('tree.docx');