mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
63 lines
1.2 KiB
PHP
Executable File
63 lines
1.2 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Jingga
|
|
*
|
|
* PHP Version 8.1
|
|
*
|
|
* @package phpOMS\Utils\Parser\Presentation
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 2.0
|
|
* @version 1.0.0
|
|
* @link https://jingga.app
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace phpOMS\Utils\Parser\Presentation;
|
|
|
|
use PhpOffice\PhpPresentation\IOFactory;
|
|
|
|
/**
|
|
* Presentation parser class.
|
|
*
|
|
* @package phpOMS\Utils\Parser\Presentation
|
|
* @license OMS License 2.0
|
|
* @link https://jingga.app
|
|
* @since 1.0.0
|
|
*/
|
|
final class PresentationParser
|
|
{
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @since 1.0.0
|
|
* @codeCoverageIgnore
|
|
*/
|
|
private function __construct()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Presentation to string
|
|
*
|
|
* @param string $path Path
|
|
*
|
|
* @return string
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public static function parsePresentation(string $path, string $output = 'html') : string
|
|
{
|
|
if ($output === 'html') {
|
|
// $pptReader = IOFactory::createReader('PowerPoint2007');
|
|
// $pptReader->load(...);
|
|
$presentation = IOFactory::load($path);
|
|
|
|
$oTree = new PresentationWriter($presentation);
|
|
|
|
return $oTree->renderHtml();
|
|
}
|
|
|
|
return '';
|
|
}
|
|
}
|