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.
Using native Word formatting with HTML - this is a great feature PHPDocX 3.0.
I needed to format the header for use with table of contents, and now I'm almost completely in control header with html.
But unfortunately I can not control the setting font-weight.
In different situations, it must have a different value (normal, bold etc.), But the title is always bold. ((
This is not enough for complex document.
Is there any solution to this problem?
For example headers with different format:
[b]Chapter 1. PHPDocX - great tool[/b] (it's bold header) (is sent to the TOC)
1.1 Using native Word formatting with HTML (i needn't bold it) (is sent to the TOC)
[i]1.1.1 Formatting headers with HTML[/i] (i needn't bold it) (is sent to the TOC)
You can create a custom template, import the styles and use them in your document. This example may help you http://www.phpdocx.com/showCode.php?dir=easy&file=ImportWordStyles.php .
Thanks, but this solution is not suitable. Your solution is good for the company, where it is necessary to create a single document type.
Users of my application to dynamically generate documents and themselves determine the full design of the document in the settings.
Very much to ask the developers to do a full format headers with css. This is very important, despite the fact that a very small thing.
We'll study how to add that feature.
I tried importStyles and it works for me.
for each header's style I created two versions - normal and bold
other parameters the user sets dynamically
I also changed the Normal style and it worked out other problems with the formatting of the table of contents
thank you, comments off
I've got a similar issue. But I haven't understood what you were doing to solve it. Can you please post some example code? That would be very nice.
What version of PHPDocX are you using?
I recently updated to 3.2. But this didn't solve the problem.