Forum


Replies: 6   Views: 3737
Importstyles doesnt work for bullets
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 webdzinez  · 17-10-2013 - 19:14

We have a special bullet list with different left indent and hanging than normal. (CreateListStyle already doesnt work because the bullet size comes out to be very small). We tried doing the importStyles method and it fails as well.



With merge, style doesnt get imported as a bulleted list, with replace, the style gets imported as a bulleted list, but doesnt get applied - when we try to manually apply it, the left indent is wrong - it has an offset of 0.25 inches.



 



Is there a sample to import custom bulleted list?



The code - 



<?php



require_once '../phpdocx3.5/classes/CreateDocx.inc';



$docx = new CreateDocx();



$docx->importStyles('./styles.docx', 'merge', array('cbs_cars_bullets'));



//Also tried $docx->importStyles('./styles.docx', 'replace', array('cbs_cars_bullets'));



 



$docx->addText('asdfasdfas asdfas asdfas fasfasfdasfasdfasfas asdfasdfasfasf',array('pStyle' => 'cbs_cars_bullets', ));



//Also tried $docx->addList( array ('asdfasdfas'),array('pStyle' => 'cbs_cars_bullets', ));



$docx->createDocx('example_import_word_styles');