PHP Classes

HTML working Form in DOC

Recommend this page to a friend!

      VS PHP Word HTML  >  All threads  >  HTML working Form in DOC  >  (Un) Subscribe thread alerts  
Subject:HTML working Form in DOC
Summary:Add HTML form in DOC file
Messages:7
Author:jack smith
Date:2016-06-23 14:10:22
 

  1. HTML working Form in DOC   Reply   Report abuse  
Picture of jack smith jack smith - 2016-06-23 14:10:22
Hi,

Thanks for the great Service.

I just want know that can if I add the HTML code in like "<input type="checkbox""/> is this click-able in doc file as well.

Please let me know your feedback on this.

Thanks

  2. Re: HTML working Form in DOC   Reply   Report abuse  
Picture of Raskin Veniamin Raskin Veniamin - 2016-06-23 20:19:39 - In reply to message 1 from jack smith
hello. I dont understand you. What do you want do? Parser tag <input>/ You may add handler.

For example:
github.com/vench/vsword/blob/master ...


add code

if($tagName == 'input' && isset($attributes['type']) && $attributes['type'] == 'checkbox') {
do something....
}

  3. Re: HTML working Form in DOC   Reply   Report abuse  
Picture of jack smith jack smith - 2016-06-24 06:36:51 - In reply to message 2 from Raskin Veniamin
Hi,

Thanks for your feedback.

My question is I want to add check box in doc file so user can click it in doc file.

you can download test.docx and get what I want in doc file
citsprojects.in/citsprojects/vstest ...

Thanks

  4. Re: HTML working Form in DOC   Reply   Report abuse  
Picture of Raskin Veniamin Raskin Veniamin - 2016-06-24 19:58:47 - In reply to message 3 from jack smith
Ok.
Try my example.

github.com/vench/vsword/blob/master ...

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;
}

  5. Re: HTML working Form in DOC   Reply   Report abuse  
Picture of jack smith 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');

  6. Re: HTML working Form in DOC   Reply   Report abuse  
Picture of jack smith jack smith - 2016-07-04 08:23:27 - In reply to message 5 from jack smith
Any Update ?

  7. Re: HTML working Form in DOC   Reply   Report abuse  
Picture of Raskin Veniamin Raskin Veniamin - 2016-08-10 04:49:33 - In reply to message 6 from jack smith
Of Course, your file empty, since you adds nothing.

Add content to $p = new PCompositeNode();