Forum


Replies: 6   Views: 3739
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');



 



 



 


Posted by jorgelj  · 17-10-2013 - 19:27

Hi,



You need to use importSingleNumbering method from CreateDocx class, there's no example yet but it will be added soon. I recommend you to check the included phpdoc of the method.



Regards.


Posted by webdzinez  · 17-10-2013 - 21:39

I looked at the phpdoc and it makes no sense to me. what is a numbers.xml ? Where do I get it from? Could you please help point me in right direction?


Posted by jorgelj  · 18-10-2013 - 10:08

Hello,



We're checking it and creating an example.



Regards.


Posted by jorgelj  · 18-10-2013 - 13:34

Hello,



Could yout attach the document to test it?.



Regards.


Posted by webdzinez  · 18-10-2013 - 15:50

How do I attach a document here? Which document do you need, a template of one I am trying to create programmatically? Can I send via email ?