Giter Club home page Giter Club logo

Comments (5)

cangelis avatar cangelis commented on August 19, 2024

I just published an update for the pdf generator. Can you run composer update and see whether the issue is resolved or not?

from l4pdf.

BnSmth avatar BnSmth commented on August 19, 2024

I have run composer update.Using download('laravel.pdf') as I was before no longer produces an error but it is also no longer producing a file in the app/storage directory and when I navigate to the url in my browser produces a white page with no pdf being downloaded.

If I run PDF::loadUrl('http://www.laravel.com')->save('/vagrant/app/storage/laravel.pdf'); then everything is working correctly, with the pdf being created and saved in the storage directory.

Thanks for the quick response :)

from l4pdf.

cangelis avatar cangelis commented on August 19, 2024

app/storage folder is used for saving temporary files so you generally don't see any file related to l4pdf because they are deleted after the pdf is generated.

I have no idea why download() is not working. Are you sure you are returning the download() as a response ?

Route::get('/', function()
{
    return PDF::loadUrl('http://www.laravel.com')->download('test.pdf');
});

from l4pdf.

BnSmth avatar BnSmth commented on August 19, 2024

Aha... I was trying to get stream working and it wasn't until I realised I wasn't returning the result. Using:

return PDF::loadUrl('http://www.laravel.com')->serve('laravel.pdf');

was working as expected so I tried using download whilst returning the result and it is also working.

Having reviewed the examples on the main repo page I see I should have been doing this from the very start, I think what threw me was that the first example doesn't use return though I guess this should have been obvious.

Oh well, glad I got it solved and thank you for the rapid response and just in general for this excellent package, looking forward to using it in production.

from l4pdf.

cangelis avatar cangelis commented on August 19, 2024

Great! Enjoy!

from l4pdf.

Related Issues (11)

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.