getStyle(); if (!$style instanceof \PhpOffice\PhpWord\Style\Frame) { return; } $xmlWriter = $this->getXmlWriter(); $styles = array(); $properties = array( 'left' => 'margin-left', 'top' => 'margin-top', 'width' => 'width', 'height' => 'height', ); foreach ($properties as $key => $property) { $method = "get{$key}"; $value = $style->$method(); if ($value !== null) { $styles[$property] = $style->$method() . 'pt'; } } $xmlWriter->writeAttribute('style', $this->assembleStyle($styles)); } }