-
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
文本框中缺少表格元素(Missing Table element in Textbox) #2349
Labels
Comments
我根据 #2183 老哥提供方案进行了修改。 在 phpoffice\phpword\src\PhpWord\Reader\Word2007\AbstractPart.php 文件的第249行添加 // 文本框中表格丢失找回
$textbox = $xmlReader->getElement('v:shape/v:textbox', $node);
if (null !== $textbox) {
$textboxLength = $xmlReader->getElements('w:txbxContent/w:tbl', $textbox);
if (null !== $textboxLength) {
foreach ($textboxLength as $item) {
$this->readTable($xmlReader, $item, $parent, $docPart);
}
}
} else {
// Image 在 phpoffice\phpword\src\PhpWord\Element\AbstractContainer.php 文件的第243行,数组中添加(TextRun) 'Table' => array('Section', 'Header', 'Footer', 'Cell', 'TextBox' , 'TextRun'), |
thanks! #2183 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the Bug
在word2007格式(docx)读取文件时,如果内容在文本框中的表格中,我无法获取到它们。
T10.docx
Steps to Reproduce
Expected Behavior
可以将textbox中表格的内容读取出来。
Current Behavior
无法读取到textbox中表格内容。
Context
The text was updated successfully, but these errors were encountered: