1

I'm using library PDFparser (https://github.com/smalot/pdfparser) to convert PDF file to text.

When I try to convert a file on a local web-server, it parses OK. When I try to convert a file on remote web-server, it fails with the following error: TCPDF_PARSER ERROR: Invalid object reference: Array.

I couldn't find a proper solution in the bug-tracker of a library, although there is exist the similar question (it didn't solved for two years).

How can I avoid this error? Or should I use another library for converting pdf to text (which)?

I am using it straight as mentioned in documentation:

use Smalot\PdfParser\Parser;

$this->parser = new Parser;

if (file_exists($full_path) && !is_dir($full_path)) {
    $paper->text = $this->parser->parseFile($full_path)->getText();
}

0 Answers0