spatie / pdf-to-text

Extract text from a pdf

Home Page:https://freek.dev/348-a-package-to-extract-text-from-a-pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Namespace Error Usage of This code

AidaAmini opened this issue · comments

Hi,

I am trying to use this code and here is the function that I am using

setPdf('book.pdf') ->text(); echo text; } get_txt(); I am getting this error. herePHP Fatal error: Uncaught Error: Class 'Spatie\PdfToText\Pdf' not found in /Users/aminialocal/Documents/project/pdftotext/t.php:18 Can you help me how to fix this problem?

That file name where PHP is looking in for the class seems off.

Did you install the package with composer? If so, run composer dump-autoload and try again.

I am still getting the same issue, Should I end up having a folder called Spatie in my working place?

Have you installed this package with composer require spatie/pdf-to-text?

I am also facing the same issue.

I did install pdf-to-text using composer.

I also did composer dump-autoload but still the error remains.

@AidaAmini @ayushpratap

just a question, did you included the autoload.php from the vendor folder which were created upon composer require ..?

I can't recreate this problem. Can anybody provide steps on how to get this error on MacOS?

@freekmurze there is no problem, in your Usage in Readme you dont say that you include vendor/autoload.php ;) (thats what i assume)

Reopen the issue if the suggestion of @BlackScorp did not fix your problem.

I have the same problem.