LaravelDaily / laravel-invoices

Laravel package to generate PDF invoices from various customizable parameters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invoices are unreadable and too big

safeboot opened this issue · comments

Describe the bug
When an order is created, a receipt will be generated for the end-user. However all the content is insanely big and unreadable.

To Reproduce
Steps to reproduce the behavior:

  1. Set Paper Size to A7
  2. Generate Receipt
  3. View Receipt
  4. See error

Expected behavior
I want a standard, A7 size receipt to be printed with the text being fit to correct size.

Screenshots
https://i.imgur.com/Qq2HbAQ.png

Desktop (please complete the following information):

  • OS: Windows 10 21H2
  • Browser: Opera GX
  • Laravel: v9.2
  • Laravel-Invoices: v3.0

Additional context

$client = new Party([

            'name' => $center->name,
            'address' => $center->address,
            'custom_fields' => [

                'Phone' => $center->contact_phone,
                'Email' => $center->contact_email,
                'Website' => $center->website,

            ]

        ]);

        $customer = new Buyer([

            'name' => $user->username,
            'custom_fields' => [

                'Full Name' => $user->full_name,
                'Email' => $user->email,
                'Phone' => $user->phone,

            ]

        ]);

        $invoice = Invoice::make('receipt')
            ->template('default')
            ->status('paid')
            ->seller($client)
            ->buyer($customer)
            ->date(now())
            ->currencySymbol('$')
            ->currencyCode('USD')
            ->currencyFormat('{SYMBOL}{VALUE}')
            ->logo(public_path('assets/logos/single_black_ambience.png'))
            ->filename($center->slug . '-' . $order->order_id);

        foreach ($order->products as $product) {

            $item = Invoice::makeItem($product->name)
                ->pricePerUnit($product->price)
                ->quantity($product->pivot->quantity);

            $invoice->addItem($item);

        }

        $invoice->save('receipts');