The only topic I can find related to this is https://www.phpdocx.com/en/forum/default/topic/1633 but the information there doesn't work.
I am loading a document using CreateDocxFromTemplate, and there is a placeholder image in there with a placeholder of $FLOORPLAN$. I need to do is get its width, because I can't just use replacePlaceholderImage as it will squash the image (the floor plans are different sizes), and I can't set the width as I don't know the width of the placeholder image (it changes between templates).
I thought this would work looking at Indexer.php, but it requires DOMDocument and I can't see a way to create that from CreateDocxFromTemplate.
// load XML content
$contentDOM = new DOMDocument();
$contentDOM->loadXML($xml); # How do I do this with CreateDocxFromTemplate??
// do a xpath query getting only image tags
$contentXpath = new DOMXPath($contentDOM);
$contentXpath->registerNamespace('rel', 'http://schemas.openxmlformats.org/package/2006/relationships');
$imageEntries = $contentXpath->query('//rel:Relationship[@Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"]');
How do I simply get the width of a placeholder image?