php - How to create a PHPDocX-generated Word file that contains styled text with inline HTML -
i'm using phpdocx, , want create word file bunch of text both contains inline html tags (e.g., <b></b>) , needs styled (e.g., justified, have font set, etc.).
i've tried using addtext method, html tags show literally. tried using embedhtml method, seems there no way style text farther when method used.
ideally, i'd utilize addtext, @ same time, have inline html tags render text accordingly. there way this? give thanks you.
edit: had considered breaking text apart on html tags, , using addtext method multiple times per text block style text accordingly, problem method every time utilize addtext, new paragraph element create. if possible append multiple pieces of text addtext , have them in same paragraph, think possible.
any thoughts?
i found reply question. "example #2" on next page of official documentation explains how underline / create bold parts of text within paragraph: http://www.phpdocx.com/api-documentation/word-content/add-paragraph-text-word-document-with-php
the main thought $text argument addtext needs array text stored in 'text' key.
php html text-formatting phpdocx
No comments:
Post a Comment