Forum


Replies: 1   Views: 1381
How to remove lines created in word?
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 admin  · 22-12-2020 - 07:02

Hello,

addShape adds w:pict tags that are supported by MS Word, LibreOffice and other DOCX readers:

<w:p>
  <w:r>
    <w:pict>
      <v:line from="10,10" strokecolor="#ff0000" strokeweight="1pt" style="position:absolute;margin-left:20pt;z-index:67407;" to="150,150"/>
    </w:pict>
  </w:r>
</w:p>

But your MS Word program has generated other code for the blue line using <w:drawing> tags.  As these tags are not directly supported by removeWordContent setting a secific type, you'd need to use a custom query to remove them based on w:p/w:r//w:drawing XPath. In the package (DOCXPath folder) you can find samples about using custom queries with DOCXPath.

About Google Drive compatiblity, please note that it doesn't support all OOXML standard, so some contents may not appear.

Regards.