The package returns an empty string instead of html code or pdf #533
Replies: 5 comments 8 replies
-
How did you solve this? I'm seeing the same issue happening on Forge. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm facing the same issue, I've got Node v20 and all dependencies installed. Any ideas ? |
Beta Was this translation helpful? Give feedback.
-
Not sure if this answer applies to everyone's situation, but I was able to get it to print content using the following: $storagePath = "customer-histories/customer-{$customer->uuid}.pdf";
$pdf = Browsershot
::html(view("pdfs.customer-history", compact("customer"))->render())
->emulateMedia("screen")
->showBackground()
->noSandbox()
->setOption('args', ['--disable-web-security'])
->format("Letter")
->margins(0.25, 0.25, 0.25, 0.25, "in");
Storage::disk("s3")
->put($storagePath, $pdf->pdf()); (I do still have the other issue with having to run |
Beta Was this translation helpful? Give feedback.
-
So you made it work just by playing with the options ? |
Beta Was this translation helpful? Give feedback.
-
If anyone else happens to come across this problem with Forge, it is definitely to do with write permissions when attempting to run Chromium.
And as @cxammar mentioned, our server deployment script will then also run |
Beta Was this translation helpful? Give feedback.
-
OS: Ubuntu 18.04.4 LTS
Laravel 7
PHP 7.4.3
Js and php packages installed:
The following code examples are used:
However, in both cases, only the empty string "" is returned instead of the expected html content or pdf content.
Locally on windows, it all works fine.
Beta Was this translation helpful? Give feedback.
All reactions