I
I
Ivan Ivanov2021-04-07 20:08:48
Kohana
Ivan Ivanov, 2021-04-07 20:08:48

How to correctly include the pdf-to-html library in the Koseven (Kohana) project?

I use https://github.com/mgufrone/pdf-to-html
When I use the code simply in the /test.php file, then everything is ok, the code works:

<?php
ini_set('display_errors', 1);
require __DIR__ . '/vendor/autoload.php';
$pdf = new Gufy\PdfToHtml\Pdf( '1.pdf');

$html = $pdf->html();
var_dump($html);


When I use the code in the kohana controller, I see errors:
Warning: file_get_contents(/home/user/web/site.my/public_html/vendor/gufy/pdftohtml-php/src/../output/606de48826859/1-1.html): failed to open stream: Нет такого файла или каталога in /home/user/web/site.my/public_html/vendor/gufy/pdftohtml-php/src/Html.php on line 41


I include autoload.php in bootstrap.php before declaring routes. I tried to install pdf-to-html in the application folder and connect autoload from there - it did not help. The controller in which I use the code is Test.php, action_pdf.
require 'vendor/autoload.php';

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question