I am using following code and getting issue if there is an space in image name. And the issue is basically file is not loading at popwerpoint slide.
like:
$shape->setPath("C:/image/abc1.jpg"); // Working fine
$shape->setPath("C:/image/abc 1.jpg"); // Not working due to space in filename
I'm using the PHPPowerPoint class for generating powerpoint slides.
How do I get this to work?
EDIT
For the benefit of roine
public function setPath($pValue = '', $pVerifyFile = true) {
if ($pVerifyFile) {
if (file_exists($pValue)) {
$this->_path = $pValue;
if ($this->_width == 0 && $this->_height == 0) {
// Get width/height
list($this->_width, $this->_height) = getimagesize($pValue);
}
} else {
throw new Exception("File $pValue not found!");
}
} else {
$this->_path = $pValue;
}
return $this;
}
Try:
If that works, you can use a simple string replace.