Я использую библиотеку PHPWord и испытываю трудности с использованием библиотеки для чтения этого XML trex
<mc:AlternateContent>
<mc:Choice Requires="wps">
<w:drawing>
<wp:anchor distT="0" distB="0" distL="114300" distR="114300" simplePos="0" relativeHeight="251657728" behindDoc="1" locked="0" layoutInCell="1" allowOverlap="1">
<wp:simplePos x="0" y="0" />
<wp:positionH relativeFrom="column">
<wp:posOffset>-54610</wp:posOffset>
</wp:positionH>
<wp:positionV relativeFrom="paragraph">
<wp:posOffset>132715</wp:posOffset>
</wp:positionV>
<wp:extent cx="5470525" cy="657225" />
<wp:effectExtent l="6350" t="0" r="0" b="0" />
<wp:wrapNone />
<wp:docPr id="2" name="Rectangle 5" />
<wp:cNvGraphicFramePr>
<a:graphicFrameLocks
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" />
</wp:cNvGraphicFramePr>
<a:graphic
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
<a:graphicData uri="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">
<wps:wsp>
<wps:cNvSpPr>
<a:spLocks noChangeArrowheads="1" />
</wps:cNvSpPr>
<wps:spPr bwMode="auto">
<a:xfrm>
<a:off x="0" y="0" />
<a:ext cx="5470525" cy="657225" />
</a:xfrm>
<a:prstGeom prst="rect">
<a:avLst />
</a:prstGeom>
<a:solidFill>
<a:srgbClr val="DBE5F1">
<a:alpha val="50000" />
</a:srgbClr>
</a:solidFill>
<a:ln>
<a:noFill />
</a:ln>
<a:extLst>
<a:ext uri="{91240B29-F687-4F45-9708-019B960494DF}">
<a14:hiddenLine
xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" w="9525">
<a:solidFill>
<a:srgbClr val="000000" />
</a:solidFill>
<a:miter lim="800000" />
<a:headEnd />
<a:tailEnd />
</a14:hiddenLine>
</a:ext>
</a:extLst>
</wps:spPr>
<wps:bodyPr rot="0" vert="horz" wrap="square" lIns="91440" tIns="45720" rIns="91440" bIns="45720" anchor="t" anchorCtr="0" upright="1">
<a:noAutofit />
</wps:bodyPr>
</wps:wsp>
</a:graphicData>
</a:graphic>
<wp14:sizeRelH relativeFrom="page">
<wp14:pctWidth>0</wp14:pctWidth>
</wp14:sizeRelH>
<wp14:sizeRelV relativeFrom="page">
<wp14:pctHeight>0</wp14:pctHeight>
</wp14:sizeRelV>
</wp:anchor>
</w:drawing>
</mc:Choice>
<mc:Fallback>
<w:pict>
<v:rect w14:anchorId="3C49E1DC" id="Rectangle 5" o:spid="_x0000_s1026" style="position:absolute;margin-left:-4.3pt;margin-top:10.45pt;width:430.75pt;height:51.75pt;z-index:-251658752;visibility:visible;mso-wrap-style:square;mso-width-percent:0;mso-height-percent:0;mso-wrap-distance-left:9pt;mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;mso-wrap-distance-bottom:0;mso-position-horizontal:absolute;mso-position-horizontal-relative:text;mso-position-vertical:absolute;mso-position-vertical-relative:text;mso-width-percent:0;mso-height-percent:0;mso-width-relative:page;mso-height-relative:page;v-text-anchor:top" o:gfxdata="UEsDBBQABgAIAAAAIQC2gziS/gAAAOEBAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbJSRQU7DMBBF
90jcwfIWJU67QAgl6YK0S0CoHGBkTxKLZGx5TGhvj5O2G0SRWNoz/78nu9wcxkFMGNg6quQqL6RA
0s5Y6ir5vt9lD1JwBDIwOMJKHpHlpr69KfdHjyxSmriSfYz+USnWPY7AufNIadK6MEJMx9ApD/oD
OlTrorhX2lFEilmcO2RdNtjC5xDF9pCuTyYBB5bi6bQ4syoJ3g9WQ0ymaiLzg5KdCXlKLjvcW893
SUOqXwnz5DrgnHtJTxOsQfEKIT7DmDSUCaxw7Rqn8787ZsmRM9e2VmPeBN4uqYvTtW7jvijg9N/y
JsXecLq0q+WD6m8AAAD//wMAUEsDBBQABgAIAAAAIQA4/SH/1gAAAJQBAAALAAAAX3JlbHMvLnJl
bHOkkMFqwzAMhu+DvYPRfXGawxijTi+j0GvpHsDYimMaW0Yy2fr2M4PBMnrbUb/Q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5DkYBygDDnJ+sz0+I
bAGqwQ6juLx18Q3YasM3PUSKnZfqGuTZ8aAcL92YFeTtDRjBwODwXPgZP7eD18ujtvgFAAD//wMA
UEsDBBQABgAIAAAAIQBFxM1S3QAAAAkBAAAPAAAAZHJzL2Rvd25yZXYueG1sTI/BasMwDIbvg72D
UWGX0TozXcmyOKUURmG3pWNnNXZj09gOtttkbz/ttN0k/o9fn+rt7AZ20zHZ4CU8rQpg2ndBWd9L
+Dy+LUtgKaNXOASvJXzrBNvm/q7GSoXJf+hbm3tGJT5VKMHkPFacp85oh2kVRu0pO4foMNMae64i
TlTuBi6KYsMdWk8XDI56b3R3aa9OQjJ2Zwc8TOWj2Mcztvb98NVK+bCYd6/Asp7zHwy/+qQODTmd
wtWrxAYJy3JDpARRvACjvHwWNJwIFOs18Kbm/z9ofgAAAP//AwBQSwECLQAUAAYACAAAACEAtoM4
kv4AAADhAQAAEwAAAAAAAAAAAAAAAAAAAAAAW0NvbnRlbnRfVHlwZXNdLnhtbFBLAQItABQABgAI
AAAAIQA4/SH/1gAAAJQBAAALAAAAAAAAAAAAAAAAAC8BAABfcmVscy8ucmVsc1BLAQItABQABgAI
AAAAIQCH0ufrjAIAABwFAAAOAAAAAAAAAAAAAAAAAC4CAABkcnMvZTJvRG9jLnhtbFBLAQItABQA
BgAIAAAAIQBFxM1S3QAAAAkBAAAPAAAAAAAAAAAAAAAAAOYEAABkcnMvZG93bnJldi54bWxQSwUG
AAAAAAQABADzAAAA8AUAAAAA
" fillcolor="#dbe5f1" stroked="f">
<v:fill opacity="32896f" />
</v:rect>
</w:pict>
</mc:Fallback>
</mc:AlternateContent>
Я использую следующий код для чтения файла слова
if ($model->getIsNewRecord()) {
$phpWord = \PhpOffice\PhpWord\IOFactory::load(
\Yii::getAlias('@app') . '/web/test.docx'
);
$htmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'HTML');
$model->corpo = $htmlWriter->getContent();
}
Моя проблема заключается в том, как правильно реализовать, чтобы библиотека могла читать тег <w:drawing>
, и я анализировал xml и увидел что-то, что может быть изображением. Я не уверен, тег <w:pict> <v:rect>
<w:pict>
<v:rect w14:anchorId="3C49E1DC" id="Rectangle 5" o:spid="_x0000_s1026" style="position:absolute;margin-left:-4.3pt;margin-top:10.45pt;width:430.75pt;height:51.75pt;z-index:-251658752;visibility:visible;mso-wrap-style:square;mso-width-percent:0;mso-height-percent:0;mso-wrap-distance-left:9pt;mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;mso-wrap-distance-bottom:0;mso-position-horizontal:absolute;mso-position-horizontal-relative:text;mso-position-vertical:absolute;mso-position-vertical-relative:text;mso-width-percent:0;mso-height-percent:0;mso-width-relative:page;mso-height-relative:page;v-text-anchor:top" o:gfxdata="UEsDBBQABgAIAAAAIQC2gziS/gAAAOEBAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbJSRQU7DMBBF
90jcwfIWJU67QAgl6YK0S0CoHGBkTxKLZGx5TGhvj5O2G0SRWNoz/78nu9wcxkFMGNg6quQqL6RA
0s5Y6ir5vt9lD1JwBDIwOMJKHpHlpr69KfdHjyxSmriSfYz+USnWPY7AufNIadK6MEJMx9ApD/oD
OlTrorhX2lFEilmcO2RdNtjC5xDF9pCuTyYBB5bi6bQ4syoJ3g9WQ0ymaiLzg5KdCXlKLjvcW893
SUOqXwnz5DrgnHtJTxOsQfEKIT7DmDSUCaxw7Rqn8787ZsmRM9e2VmPeBN4uqYvTtW7jvijg9N/y
JsXecLq0q+WD6m8AAAD//wMAUEsDBBQABgAIAAAAIQA4/SH/1gAAAJQBAAALAAAAX3JlbHMvLnJl
bHOkkMFqwzAMhu+DvYPRfXGawxijTi+j0GvpHsDYimMaW0Yy2fr2M4PBMnrbUb/Q94l/f/hMi1qR
JVI2sOt6UJgd+ZiDgffL8ekFlFSbvV0oo4EbChzGx4f9GRdb25HMsYhqlCwG5lrLq9biZkxWOiqY
22YiTra2kYMu1l1tQD30/bPm3wwYN0x18gb45AdQl1tp5j/sF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ZHJzL2Rvd25yZXYueG1sTI/BasMwDIbvg72D
UWGX0TozXcmyOKUURmG3pWNnNXZj09gOtttkbz/ttN0k/o9fn+rt7AZ20zHZ4CU8rQpg2ndBWd9L
+Dy+LUtgKaNXOASvJXzrBNvm/q7GSoXJf+hbm3tGJT5VKMHkPFacp85oh2kVRu0pO4foMNMae64i
TlTuBi6KYsMdWk8XDI56b3R3aa9OQjJ2Zwc8TOWj2Mcztvb98NVK+bCYd6/Asp7zHwy/+qQODTmd
wtWrxAYJy3JDpARRvACjvHwWNJwIFOs18Kbm/z9ofgAAAP//AwBQSwECLQAUAAYACAAAACEAtoM4
kv4AAADhAQAAEwAAAAAAAAAAAAAAAAAAAAAAW0NvbnRlbnRfVHlwZXNdLnhtbFBLAQItABQABgAI
AAAAIQA4/SH/1gAAAJQBAAALAAAAAAAAAAAAAAAAAC8BAABfcmVscy8ucmVsc1BLAQItABQABgAI
AAAAIQCH0ufrjAIAABwFAAAOAAAAAAAAAAAAAAAAAC4CAABkcnMvZTJvRG9jLnhtbFBLAQItABQA
BgAIAAAAIQBFxM1S3QAAAAkBAAAPAAAAAAAAAAAAAAAAAOYEAABkcnMvZG93bnJldi54bWxQSwUG
AAAAAAQABADzAAAA8AUAAAAA
" fillcolor="#dbe5f1" stroked="f">
<v:fill opacity="32896f" />
</v:rect>
</w:pict>
Как вы можете увидеть этот отрывок и где я думаю, что это часть изображения
И HTML, который я пытаюсь сгенерировать, два изображения docx находятся в верхнем и нижнем колонтитулах, иМне нужно, чтобы эти два изображения были в формате html, текст со стилем работал нормально, только изображение, которое его не приносит.