Forum


Replies: 8   Views: 3452
Using native word formatting with html
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 pphornet  · 15-01-2013 - 06:53

Hello!

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)

Posted by admin  · 11-04-2013 - 12:13

Hello,

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 .

Regards.

Posted by pphornet  · 11-04-2013 - 12:13

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.

Posted by admin  · 11-04-2013 - 12:13

Hello,

We'll study how to add that feature.

Regards.

Posted by pphornet  · 11-04-2013 - 12:13

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

Posted by HalloWelt  · 11-04-2013 - 12:13

Hi pphornet,

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.

best regards,
Robert

Posted by admin  · 11-04-2013 - 12:13

Hello,

What version of PHPDocX are you using?

Regards.

Posted by HalloWelt  · 11-04-2013 - 12:13

I recently updated to 3.2. But this didn't solve the problem.