You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I've been having an issue for a while regarding tabs in titles. Tabs do not work at all, looking deeper into the code I have seen that titles actually support TextRuns. Using a TextRun in the title causes the tab issue to go away. However, the docx file now errors on open (although the content is all there) and TOC has issues (Text missing).
How to Reproduce
<?php$titleText = newTextRun();
$titleText->addText("Hello \t");
$titleText->addText('Some other text');
$sceneSection->addTitle($titleText, 1);
The text was updated successfully, but these errors were encountered:
This work for me: PhpOffice\PhpWord\Writer\Word2007\Element\TOC
On line 100, change that line to:
`
if (get_class($title->getText()) === 'PhpOffice\PhpWord\Element\TextRun') {
Thanks @koolkiizz , you saved me tons of time.
my php version reports a warning when a string passed to get_class, so I used gettype, not good but works for me now.
This is:
So I've been having an issue for a while regarding tabs in titles. Tabs do not work at all, looking deeper into the code I have seen that titles actually support TextRuns. Using a TextRun in the title causes the tab issue to go away. However, the docx file now errors on open (although the content is all there) and TOC has issues (Text missing).
How to Reproduce
The text was updated successfully, but these errors were encountered: