Forum


Replies: 10   Views: 4243
Embedhtml with wordstyles on inline elements
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 mguillermin  · 04-10-2013 - 12:22

Hi,



I don't manage to correctly set a specific word style on a inline element (a <span> in my case).



Here is an extract from my code : 



$docx = new CreateDocx($myTemplate);

$content = '<p><span class="marker">test</span></p>';

$wordStyles = array(

  '.marker' => 'Highlight'

);



$docx->embedHTML($content, array(

  'strictWordStyles' => true,

  'wordStyles' => $wordStyles,

));

$docx->createDocxAndDownload();



The "Highlight" style is defined in my template (it's a character style), but it is not applied by PHPDocx on my "test" content.



Do you know how to achieve that ?



Thanks, 



Matthieu


Posted by jorgelj  · 07-10-2013 - 10:10

Hello,



We're checking your issue.



Regards.


Posted by mguillermin  · 08-10-2013 - 11:08

Thanks. Tell me if you need more informations.



Regards


Posted by jorgelj  · 09-10-2013 - 09:03

Hello,



Could you attach or send your template? We have done some tests and everything works fine.



Regards.


Posted by mguillermin  · 10-10-2013 - 09:30

The template with the "Highlight" style is available here.



And a sample of a generated document here.



Regards


Posted by mguillermin  · 18-10-2013 - 17:17

Hi,



Do you have any news about this problem ?



Thanks,



Matthieu


Posted by jorgelj  · 21-10-2013 - 10:29

Hello,



We're checking it. As it's a character style and not a paragraph style we're testing some examples.



Regards.


Posted by mguillermin  · 08-11-2013 - 14:18

Hello,



Do not hesitate to tell me if you need more informations or another test case about this point.



Thanks,



Matthieu


Posted by jorgelj  · 11-11-2013 - 09:01

Hi,



We're doing the needed changes to support character styles, because the current version support paragraphs, lists, tables and others but not character styles.



Meanwhile you can set a similar style using HTML.



Regards.


Posted by mguillermin  · 12-11-2013 - 10:31

Thank you for your answer.



That would be great if you manage to support character styles. In the meantime, I will try to use HTML styles instead of my Word styles.



Regards,



Matthieu