michaeldrennen / pandoc
A php 7 compatible wrapper around the Pandoc file conversion software.
v1.03
2018-02-26 19:30 UTC
Requires (Dev)
- phpunit/phpunit: ^6.5
- satooshi/php-coveralls: ^2.0
This package is auto-updated.
Last update: 2026-03-10 09:11:50 UTC
README
PHP 7 compatible wrapper around Pandoc (https://github.com/jgm/pandoc)
Usage
From file -> To file
$pandoc = new Pandoc(); $pandoc->fromFile('./from.txt') ->toFile('./to.docx') ->convert();
String content -> To file
$pandoc = new Pandoc(); $pandoc->content('<p>Wow, I really Cronenberged up the whole place, huh Morty?</p>') ->toFile('./to.docx') ->convert();
With exception handling
try{ $pandoc = new Pandoc(); $pandoc->fromFile('./from.txt') ->toFile('./to.docx') ->convert(); } catch(PandocException $exception) { echo $exception->getMessage(); }