PHP code example of dmitry-kuchura / pdf-to-html-php
1. Go to this page and download the library: Download dmitry-kuchura/pdf-to-html-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace App\Http\Controllers;
use Kuchura\PdfToHtml\Config;
use Kuchura\PdfToHtml\Pdf;
class PdfController
{
public function pdf()
{
Config::set('pdftohtml.bin', '/usr/bin/pdftohtml');
Config::set('pdfinfo.bin', '/usr/bin/pdfinfo');
$pdf = new Pdf(public_path() . '/test.pdf');
$html = $pdf->html();
}
}