Forum


Replies: 2   Views: 602
Remove image in textbox
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  · 06-01-2023 - 07:34

Hello,

As a textbox also uses a drawing element, you need to select the textbox tag in the query:

$referenceNode = array(
    'customQuery' => '//w:txbxContent//w:drawing[descendant::wp:docPr[contains(@descr, "$IMAGE$")]]',
);
$docx->removeWordContent($referenceNode);

//w:txbxContent has been added to the query.

If you send a sample DOCX document you are using to contact[at]phpdocx.com we can generate a custom script using it.

Regards.