pdf-to-html
pdf-to-html copied to clipboard
Class 'Gufy\PdfToHtml\Config' not found
How to solve this?
I followed the docs..
I put use Gufy\PdfToHtml\Config;
at the top and this is my controller
public function convertPdf(Request $request){
// dd($request->all());
// change pdftohtml bin location
\Gufy\PdfToHtml\Config::set('pdftohtml.bin', 'C:/wamp64/www/iaccs-admin-console/public/bin/pdftohtml.exe');
// change pdfinfo bin location
\Gufy\PdfToHtml\Config::set('pdfinfo.bin', 'C:/wamp64/www/iaccs-admin-console/public/bin/pdfinfo.exe');
// initiate
$pdf = new Gufy\PdfToHtml\Pdf($request);
// convert to html and return it as [Dom Object](https://github.com/paquettg/php-html-parser)
$html = $pdf->html();
// check if your pdf has more than one pages
$total_pages = $pdf->getPages();
// Your pdf happen to have more than one pages and you want to go another page? Got it. use this command to change the current page to page 3
$html->goToPage(1);
// and then you can do as you please with that dom, you can find any element you want
$paragraphs = $html->find('body > p');
return $paragraphs;
}