Forum


Replies: 1   Views: 760
Using embedhtml wordstyles with images
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 admin  · 03-12-2021 - 12:18

Hello,

HTML methods allow applying word styles to tables, paragraphs and characters. Each custom style can be applied to the correct contents; for example a custom paragraph style can be applied to paragraphs or headings but can't be applied to images.
On https://www.phpdocx.com/documentation/introduction/html-to-word-PHP (Using native Word formatting with HTML section) is available this same information. In the package you can also find the following sample that illustrates how to use the wordStyles option with paragraphs, tables and characters.

Borders can be added to images using HTML/CSS (https://www.phpdocx.com/htmlapi-documentation/html-standard/insert-image-Word-document-with-HTML). If you are getting a thinner border in top and bottom positions, maybe some content is overlapping it. Please check the following topic that details a very similar question: https://www.phpdocx.com/en/forum/default/topic/2199 ; we recommend adding some spacing/margin to the image or the contents to avoid that overlapping.

Regards.