Forum


Replies: 4   Views: 3967
Docx to html trubble with lists
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by techno77  · 13-08-2013 - 09:56

Hello,



I'm converting docx to HTML. Using PHPDOCX 3.3.



$document = new TransformDoc();

$document->setStrFile($docxfilename);

$document->generateXHTML();

$document->validatorXHTML();

$row["html"] = $document->getStrXHTML();



 



That's ok, but when we have markered lists in DOCX document after converting phpdocx give us <p class="ae-P">.



Regural paragraph looks like <p class="Normal-P"> after convertion.



How to fix this problem? How to get standard HTML markered list

<ul>

<li>Item 1</li>

<li>Item 2</li>

<li>Item 3</li>

</ul>



insted of not usful <p class="ae-P">???



 


Posted by jorgelj  · 14-08-2013 - 08:14

Hello,



TransformDoc method uses a XSL file to do the transformation. If you want a better output you can use the conversion plugin to export DOCX to HTML.



Regards.


Posted by techno77  · 14-08-2013 - 09:50

[quote=jorgelj]

TransformDoc method uses a XSL file to do the transformation. If you want a better output you can use the conversion plugin to export DOCX to HTML.

Regards.

[/quote]



I found only Online demo. How to use conversion plugin. I have Corporate version of PHPDOCX 3.3


Posted by jorgelj  · 14-08-2013 - 11:00

Hello,



You need to instanciate TransformDocAdv.inv class and invoke transformDocument method. You just need to set the correct output as:



transformDocument('document.docx', 'document.html')



Please read included phpdoc:



/**

     * Transform DOCX to PDF, ODT, SXW, RTF, DOC, TXT, HTML or WIKI

     *

     * @access public

     * @param $docSource

     * @param $docDestination

     * @param string $tempDir

     * @param array $options :

     *      · method : 'direct' (default), 'script' ; 'direct' method uses

     *                  passthru and 'script' uses a external script.

     *                  If you're using Apache and 'direct' doesn't work use 'script'

     *      · 'odfconverter' : true (default) or false . Use odf-converter.

     * @return void

     */



Regards.