->pdf(); nothing happens? #506
Unanswered
yankeyhotel
asked this question in
Q&A
Replies: 1 comment
-
If the PDF should be downloaded from a controller, you have to transform it into the appropriate response: $pdf = Browsershot::html('<h1>Hello</h1>')
->setNodeBinary('/usr/local/bin/node')
->setNpmBinary('/usr/local/bin/npm')
->format('Letter')
->pdf();
return \Response::make($pdf, 200, ['Content-Type' => 'application/pdf']); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am having trouble creating and then immediately downloading a PDF.
My expectation is that this would result in the pdf downloading from the browser, but nothing happens. (https://github.com/spatie/browsershot#output-directly-to-the-browser-1)
This code works just fine, the example.pdf is created and added to the root.
->screenshot()
doesn't work either. (https://github.com/spatie/browsershot#output-directly-to-the-browser)Thanks
Beta Was this translation helpful? Give feedback.
All reactions