Git Product home page Git Product logo

Comments (9)

praem90 avatar praem90 commented on September 27, 2024

Please add the below line in config/app.php to resolve the PDF facade.

'PDF' => Praem90\PDF\Facade::class,

from laravel-mpdf.

mohinithorat avatar mohinithorat commented on September 27, 2024

I am using Laravel 5, and I included it in bootstrap/app.php file.

$app->register(Praem90\PDF\ServiceProvider::class);
$app->withFacades(true, [Praem90\PDF\Facade::class => 'PDF']);

from laravel-mpdf.

praem90 avatar praem90 commented on September 27, 2024

Hope you are working in laravel version > 5.1

Updating the bootstrap/app.php file isn't a good practice and not recommended too. Please follow the recommended way and it should work fine.

https://laravel.com/docs/5.0/facades#creating-facades
https://laravel.com/docs/5.0/providers#registering-providers

from laravel-mpdf.

mohinithorat avatar mohinithorat commented on September 27, 2024

I am using Laravel/lumen framework, I cannot see app.php file in config folder.

from laravel-mpdf.

praem90 avatar praem90 commented on September 27, 2024

I've tested this package with Lumen 5.5 and its working fine.
Check this out.
https://github.com/praem90/test-mpdf-with-lumen

from laravel-mpdf.

praem90 avatar praem90 commented on September 27, 2024

Just clone the repo and install dependencies.
Run the following command in the root directory,

php -S localhost:9000 -t public

Visit localhost:9000 and you can view the test PDF

from laravel-mpdf.

mohinithorat avatar mohinithorat commented on September 27, 2024

Hi,

I am facing another prob. If I try to loadHTML, it does take too much time.

$html = '
Client Phone Number
'.'PHONE_NUMBER'.'


Client Email
'.'Email'.'


Pet Name
'.'Pet option_details'.'


Ask.Vet Text Session Date/Time
'.'concludeTime'.'


'.'CLINIC_NAME'.' Location
'.'CLINIC_LOCATION'.'
';
$mpdf = PDF::loadHtml($html);
$mpdf->Output(\URL::to('').'/thread_pdfs/pdf.pdf');

from laravel-mpdf.

praem90 avatar praem90 commented on September 27, 2024

You should provide system path (storage_path('thread_pdfs/pdf.pdf')) but URL::to() provides url (http://localhost).

from laravel-mpdf.

mohinithorat avatar mohinithorat commented on September 27, 2024

It still takes time.

from laravel-mpdf.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.