Forum


Replies: 6   Views: 4227
Default font on lists in embedhtml (strictwordstyles)
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 larrytech  · 13-03-2015 - 16:57

We're using the embedHTML method to write HTML to a Word document. When the HTML includes a list the font defaults to Times, 10. We have the following paragraph style: // Create a paragraph style for the content. $this->document->createParagraphStyle('contentStyle', [ 'color' => '000000', 'font' => 'Trebuchet MS', 'fontSize' => 22, // Font size (each size is 0.5pt when used with EmbedHTML). 'lineSpacing' => 276, // Line space (where 240 is a line space of 1). 'jc' => 'both', 'spacingTop' => 180, // Top space (1/20 of a point). 'spacingBottom' => 180, // Bottom space (1/20 of a point). 'widowControl' => 'on' // Prevents printing the last line of a paragraph at the top of the next page. ]); And this is where we add the content. // Add the content. $this->fragments['content']->embedHTML($this->presenter->toHTML($article->content), [ 'downloadImages' => true, 'strictWordStyles' => true, 'wordStyles' => [ '

' => 'contentStyle', '

  • ' => 'contentStyle' ] ]); Is there anything we're doing wrong here?