i am facing issue in converting html to word. when i convert html to word docx all heading tags are automatically set to bold in converted docx file. any one can help me to solve this issue
i am facing issue in converting html to word. when i convert html to word docx all heading tags are automatically set to bold in converted docx file. any one can help me to solve this issue
Hello,
We recommend you read the following documentation pages:
There's no issue when transforming HTML. The default CSS styles (templates/html.css file) used by phpdocx apply bold style to heading tags and other default styles.
If you don't want to apply to some default style (such as bold in HTML heading tags) you can set new styles when transforming HTML. For example:
$html = '
<style>
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
</style>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
';
$docx->embedHTML($html);
Regards.
i am facing another issue in generated docx file when i copy content from generated docx file and paste it into ckeditor then headings are not work as h1,h2 etc.
Hello,
Please note this is not a phpdocx question but from the WYSIWYG or the settings you are using. We recommend you read the WYSIWYG documentation.
If the WYSIWYG or settings you are using require using specific custom paragraph style names applied to headings, you can set them with phpdocx easily. On Working with headings using PHP methods and HTML contents you can read more information about this.
Regards.