oms-Media/Theme/Api/wordAsHtml.tpl.php
Dennis Eichhorn 9ddf6bda86
Some checks failed
Image optimization / general_image_workflow (push) Has been cancelled
CI / general_module_workflow_php (push) Has been cancelled
CI / general_module_workflow_js (push) Has been cancelled
fix permissions
2025-04-02 14:15:05 +00:00

28 lines
596 B
PHP

<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Media
* @copyright Dennis Eichhorn
* @license OMS License 2.2
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use PhpOffice\PhpWord\IOFactory;
use PhpOffice\PhpWord\Writer\HTML;
use phpOMS\Autoloader;
Autoloader::addPath(__DIR__ . '/../../../../Resources/');
$media = $this->media;
$reader = IOFactory::createReader('Word2007');
$doc = $reader->load(($media->isAbsolute ? '' : __DIR__ . '/../../../../') . $media->getPath());
$writer = new HTML($doc);
$writer->save('php://output');