PHP Classes
elePHPant
Icontem

Bugs Needing Fix

Recommend this page to a friend!

      PHP PDF to HTML  >  All threads  >  Bugs Needing Fix  >  (Un) Subscribe thread alerts  
Subject:Bugs Needing Fix
Summary:Summary of bugs
Messages:2
Author:C Smith
Date:2015-10-23 21:57:22
 

 


  1. Bugs Needing Fix   Reply   Report abuse  
C Smith - 2015-10-23 21:57:22
Hi,
Thanks for the package. I never new of Poppler but thanks to this package I am interested. I found some issues (not sure if you forgot to include an additional class file or if oversight deleting namespace). I was able to get it working by commenting out a few things in HTML class. Here are the lines one by one commenting out where issue (assuming forgot class file).

Error:
Fatal error: Class 'Pelago\Emogrifier' not found Html.php on line 88
Fatal error: Class 'TonchikTm\PdfToHtml\Emogrifier' not found in Html.php on line 88
Fatal error: Call to undefined function TonchikTm\PdfToHtml\mime_content_type() in Html.php on line 110

Thanks again for the contribution. Chris

  2. Re: Bugs Needing Fix   Reply   Report abuse  
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);