/** * check for images an calculate their maximum width * * note: the image tags will be removed from the input text, this method is required due to further * calculation in the original pdf class * * @param String $text input text * @return float calculated maximum height * @access public */ function parseMaximumWidth(&$text) { $mx = 0; $matches = $this->getImagesFromText($text); for ($key = 0; $key < count($matches[0]); $key++) { $CezShowimageParameter = new CezShowimageParameter(); $params = $CezShowimageParameter->create($matches[1][$key]); if ($params->getWidth() > $mx) { $mx = $params->getWidth(); } elseif ($params->getOriginalWidth() > $mx) { $mx = $params->getOriginalWidth(); } // remove the Image-Tag from the text for further calculation $text = str_replace($matches[0][$key], '', $text); } $mx = min($mx, $this->ezPdf->ez['pageWidth']); return $mx; }