-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using the Template Processor, the "Titles" injected will appear as simple text (no title's style) in the generated document ('cause "Heading" title style name is different on non-english docx) #1803
Comments
🙌🏼 I have found why it doesn't works ! When I use the Therefore, when I use The solution could be to let PhpWord define a custom "Heading" default name when it builds a title.
|
Same case here, with french also. |
I tried to replace in html.php file, heading3 by "Title 3" : PHPWord/src/PhpWord/Shared/Html.php Line 140 in ec1b3d3
it works as the outpule file does contain "Titre 3" in tag but does not solve the display problem and outputed docx file style does not applies style to the text. |
Hello @atlza , No, I didn't find any workaround, I've just forked the library and used the fix that I propose above; I've raised this issue one year ago now. I ask to myself if the library is still maintained ... it's strange : 120 contributors but no new released since more than 1 year and 805 opened issues 😳 |
I do have the same feeling, the lib seems unmaintened. |
Hello,
I try to include inside of a Word template a simple text with titles (text and titles generated dynamically by PHP and integrated in a "nice" Word file).
Everything went well, I've used the
TemplateProcessor
and itssetComplexBlock
.However, in the generated document, the "titles" are not really appearing as Titles but as simple text. I see that the XML generated contains the style "Heading1" but simple text appears inside Microsoft Word ...
Here some sample code :
🙏🏼 Have you ever meet that type of problem ? Do I miss something ?
Note :
You will notice that I use a "Container". It's because PhpWord don't let me to give my object
$mainSection
as second argument ofsetComplexBlock(
. I will have a error"Attempted to load class "Section" from namespace "PhpOffice\PhpWord\Writer\Word2007\Element"."
(I guess it is normal, there is no Section.php class in the Writer Elements of PhpWord).Then, I have created a
Container
(see code below) : it is a simple Class that extend thePhpWord\Element\Section
and forwards the section's elements.The text was updated successfully, but these errors were encountered: