示例#1
0
 /**
  * Test load class exception
  *
  * @expectedException \Exception
  * @expectedExceptionMessage is not a valid reader
  */
 public function testLoadClassException()
 {
     IOFactory::createReader();
 }
        $this->append('<dl>');
        $this->append('<dt>HashCode</dt><dd>' . $oShape->getHashCode() . '</dd>');
        $this->append('<dt>Offset X</dt><dd>' . $oShape->getOffsetX() . '</dd>');
        $this->append('<dt>Offset Y</dt><dd>' . $oShape->getOffsetY() . '</dd>');
        $this->append('<dt>Height</dt><dd>' . $oShape->getHeight() . '</dd>');
        $this->append('<dt>Width</dt><dd>' . $oShape->getWidth() . '</dd>');
        $this->append('<dt>Rotation</dt><dd>' . $oShape->getRotation() . '°</dd>');
        $this->append('<dt>Hyperlink</dt><dd>' . ucfirst(var_export($oShape->hasHyperlink(), true)) . '</dd>');
        $this->append('<dt>Fill</dt><dd>@Todo</dd>');
        $this->append('<dt>Border</dt><dd>@Todo</dd>');
        if ($oShape instanceof MemoryDrawing) {
            ob_start();
            call_user_func($oShape->getRenderingFunction(), $oShape->getImageResource());
            $sShapeImgContents = ob_get_contents();
            ob_end_clean();
            $this->append('<dt>Mime-Type</dt><dd>' . $oShape->getMimeType() . '</dd>');
            $this->append('<dt>Image</dt><dd><img src="data:' . $oShape->getMimeType() . ';base64,' . base64_encode($sShapeImgContents) . '"></dd>');
        } else {
            // Add another shape
        }
        $this->append('</dl>');
        $this->append('</div>');
    }
}
$pptReader = PhpOffice\PhpPowerpoint\IOFactory::createReader('PowerPoint97');
$oPHPPowerPoint = $pptReader->load('resources/Sample_12.ppt');
$oTree = new PhpPptTree($oPHPPowerPoint);
echo $oTree->display();
if (!CLI) {
    include_once 'Sample_Footer.php';
}