Setasign / FPDI

FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF.
https://www.setasign.com/fpdi
MIT License
1.05k stars 160 forks source link

setasign\\FpdiPdfParser\\PdfParser\\PdfPars Class not founded #188

Closed aliNassif10 closed 10 months ago

aliNassif10 commented 10 months ago

Hi, when i use setSourceFile in mpdf is show me this error setasign\FpdiPdfParser\PdfParser\PdfPars Class not founded and when i track error i found it in this if statement : if (\class_exists(FpdiPdfParser::class)) { /* @noinspection PhpUndefinedClassInspection / return new FpdiPdfParser($streamReader, $parserParams); } how can i solve error ?

JanSlabon commented 10 months ago

As you found the if-statment there's a comment above describing your problem:

https://github.com/Setasign/FPDI/blob/ecf0459643ec963febfb9a5d529dcd93656006a4/src/FpdiTrait.php#L132-L134

So your autoloader should ignore this and move on.

aliNassif10 commented 10 months ago

@JanSlabon Yah thank you , but already i write ‘require_once ‘vendor/autoload.php’; . I don't know why autoloader not ignore if statement

JanSlabon commented 10 months ago

It's only you who can debug where the error is triggered. The composer autoloader will not trigger an error here. It has to be another one.