We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
my config file looks like this :
return [ 'mode' => '', 'format' => 'A4', 'default_font_size' => '12', // the rest of the config ];
and when i make the pdf i use this code :
use App\Models\Invoice; use Mccarlosen\LaravelMpdf\Facades\LaravelMpdf; function print(){ $invoice = Invoice::first(); $data = []; $view = 'template_1'; $pdf = LaravelMpdf::loadView($view, $data, [ 'format' => ['100','500'], 'margin_left' => 0, 'margin_right' => 0, 'margin_top' => 0, 'margin_bottom' => 0, 'margin_header' => 0, 'margin_footer' => 0, ]); $fileName = "invoice-#{$invoice->invoice_number}.pdf"; header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename={$fileName}"); return $pdf->stream($fileName); }
the reason I am using the format ['100','500'] is to print a POS style invoice
['100','500']
the problem is that the the outcome page size is always 'A4' even if i clear all the cache using php artisan optimize:clear
php artisan optimize:clear
possible workaround : when I change the config before I load the view it works fine :
config(['pdf.format' => ['100','500']); $pdf = LaravelMpdf::loadView($view, $data, [ 'margin_left' => 0, // the rest of the code ];
is there a better solution? or a reason why it does not take the format value I am providing while loading the vue ?
format
The text was updated successfully, but these errors were encountered:
No branches or pull requests
my config file looks like this :
and when i make the pdf i use this code :
the reason I am using the format
['100','500']
is to print a POS style invoicethe problem is that the the outcome page size is always 'A4' even if i clear all the cache using
php artisan optimize:clear
possible workaround :
when I change the config before I load the view it works fine :
is there a better solution? or a reason why it does not take the
format
value I am providing while loading the vue ?The text was updated successfully, but these errors were encountered: