michaeldrennen / pandoc
A php 7 compatible wrapper around the Pandoc file conversion software.
Installs: 1 187
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires (Dev)
- phpunit/phpunit: ^6.5
- satooshi/php-coveralls: ^2.0
This package is auto-updated.
Last update: 2024-11-10 06:12:20 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(); }