Anton N Nikolaev - 2015-10-26 07:51:01 -
In reply to message 1 from C Smith
This package work with composer. Required PHP >=5.4 and package pelago/emogrifier (https://github.com/jjriv/emogrifier).
For use without composer:
<?php
require_once '../src/Base.php';
require_once '../src/Pdf.php';
require_once '../src/Html.php';
require_once '../vendor/pelago/emogrifier/Classes/Emogrifier.php';
use TonchikTm\PdfToHtml\Pdf;
$pdf = new Pdf('source/test.pdf', [
'pdftohtml_path' => '/usr/local/bin/pdftohtml',
'pdfinfo_path' => '/usr/local/bin/pdfinfo',
'generate' => [ // settings for generating html
'singlePage' => false, // we want separate pages
'imageJpeg' => false, // we want png image
'ignoreImages' => false, // we need images
'zoom' => 1.5, // scale pdf
'noFrames' => false,
],
'clearAfter' => true,
'removeOutputDir' => true,
'html' => [
'inlineImages' => true,
'onlyContent' => true,
]
]);
echo $pdf->getHtml()->getPage(1);