Warp

Print invoices and delivery notes from Filament, exactly as previewed

4 min read

It is the end of the month. The office has thirty invoices to send, and the warehouse needs a delivery note for each shipment. In many Filament apps this means a Blade view rendered to PDF: someone downloads it, opens it, finds that the 34th item row slipped off the bottom of page one, and asks a developer to change the view. When the bank account changes, the developer edits the view again.

This article shows the same invoices with Warp Print: a Print button on every invoice, a preview that shows the real pages, a template switch from invoice to delivery note, long tables that continue over pages, and many invoices in one print. All pictures are from the live demo.

The scene: a list of invoices with a Print button

The invoices are an ordinary Filament table. Each row has Print, Email and Edit. Above the table, Print list prints the list itself with its total.

A Filament table of invoices with number, customer, issue date, item count, total and status, and Print, Email and Edit buttons on each row; Print list above the table
The invoices. Every row has a Print button.

Step 1: say what can be printed

The developer writes one small class, a PrintSource. It names the model and the fields a template may use. The demo's source has more fields (the customer's address, our bank account, tax per rate), but the shape is this:

use Qalainau\FilamentWarpPrint\Sources\Field;
use Qalainau\FilamentWarpPrint\Sources\PrintSource;

class InvoiceSource extends PrintSource
{
    protected static string $model = Invoice::class;

    public function fields(): array
    {
        return [
            Field::text('number')->label('Invoice no.'),
            Field::date('issued_on'),
            Field::date('due_on'),
            Field::text('customer.name')->label('Customer'),
            Field::money('total', 'JPY')->state(fn (Invoice $invoice) => $invoice->total()),
            Field::table('items', [
                Field::text('name')->label('Item'),
                Field::number('quantity'),
                Field::money('unit_price', 'JPY'),
                Field::money('amount', 'JPY')->state(fn (InvoiceItem $item) => $item->amount()),
            ])->label('Items'),
        ];
    }
}

Register it with the plugin, and the panel gets a Print templates page. That is where the layout lives: an admin drags the fields, the logo and the item table onto an A4 page and presses Publish. No Blade view to edit when the bank account changes.

->plugin(WarpPrintPlugin::make()->sources([InvoiceSource::class]))

Step 2: the Print buttons

These are the actions of the demo's invoice table, unchanged:

->headerActions([
    PrintTableAction::make()->totals(['total'])->groupBy(),
])
->recordActions([
    PrintAction::make(),
    EmailPrintAction::make(),
    EditAction::make(),
])
->toolbarActions([
    PrintBulkAction::make(),
    EmailPrintBulkAction::make(),
])

Step 3: what you see is what prints

Press Print on an invoice. The window shows the real pages, with the page count under them. The preview is drawn by the same renderer as the printout, so the 16th row is where it will be on paper.

The print window: Template Invoice, and an A4 invoice from Warp Trading to Fabrikam Residences with the amount due A$13,370.00 and an item table; 1 record, 2 pages; a Print button
The print window. "Print" opens the browser's print dialog, which can also save a PDF.

The warehouse does not need prices. Switch Template to the delivery note, and the same invoice is shown without amounts, with a barcode for scanning at the dock.

Print, scroll, switch to the delivery note and back.
The same record printed with the delivery note template: items and quantities without prices, and a barcode
The delivery note: the same data, another template.

To offer only some templates on a button, name them: PrintAction::make()->templates(['invoice', 'delivery-note']).

Step 4: 80 rows over four pages

The real test of invoice printing is a long invoice. In the template, the item table is set to continue on the next page and to carry the total. Page 1 ends with "Carried forward", page 2 starts with "Brought forward" and a small continuation header.

The bottom of page 1 of an 80-row invoice with the carried-forward total and page 1 of 4, and the top of page 2 with the continuation header and the brought-forward total
Invoice INV-202611-0036, 80 rows: page 1 of 4 and the start of page 2.

If the last rows fit on a page but not above the totals box, Warp Print adds one more page for them. Nobody has to count rows.

Step 5: thirty invoices in one print

Tick the invoices and choose Print selected. Every invoice starts on a new page, in the order you ticked them, in one window and one print job.

The print window for 3 records, 4 pages in all, with the first invoice shown
Three invoices, four pages, one print.

Choose "Save as PDF" in the print dialog and the PDF has the same pages:

Page 1 of the invoice as a PDF, with Page 1 of 2 and the carried-forward total at the bottom
The PDF, from the same page as the preview.

Other scenes

  • Quotes and purchase orders from the same source, as other templates.
  • Price tags and address labels with barcodes: label templates fill a sheet with many records.
  • The Excel invoice your office already uses: upload it as an Excel template and Warp Print fills in the cells.
  • "Original" and "Copy", or a PAID watermark, set in the template, not in code.

Limits worth knowing

  • A PDF made on the server (for Download PDF and email attachments) needs Browsershot or Gotenberg. Without them, the browser's "Save as PDF" still works.
  • One table per template flows over pages; other tables show the rows that fit in their box.
  • The browser's print dialog may add its own header and footer (date, URL): turn them off in the dialog.
  • Printing many records at once shows up to 200 in the window (batch_limit); with more, the window offers to make the file in the background.

Try it

Open the invoices demo, press Print on any invoice and switch the template. Then open Print templates and move the logo, and print again. No sign-up, and the data is reset every hour.

More from the blog

See who is free next week and book them, in Filament

An agency manager needs 40 hours for a project that starts Monday. The planner shows only the people who have the time, the booking is a drag, and the overbooked project manager gets a fix in two clicks.

Laravel Rust vs Laravel Go vs Laravel PHP: The Complete Real-World Benchmark Guide

We benchmarked Laravel Rust, Laravel Go v0.1.0, and Laravel PHP (FPM, FrankenPHP, Swoole, Workerman) across 8 real workloads on the exact same machine — from 1,000-user spikes and heavy ORM to 100k-row deep pagination. Continuously updated as new tests land.

Work through support tickets without leaving the list, in Filament

A support agent opens a ticket, assigns it, sets it to pending and moves on to the next one with the arrow key. The list stays on the left; the View and Edit pages you already have open on the right.

Filament + AI coding tips, by email

How to fit Warp plugins into your own app and pair them with Claude Code or Cursor: prompts that work, mistakes AI makes, real examples. Once or twice a month. Unsubscribe anytime.

Ask us anything about Warp

No email address or sign-up needed.

We read every question and answer here on the site, usually within a day. Others see your question after we have checked it.

What's stopping you from using Warp's plugins?

One question. We read every answer, and it decides what we build next. It is not shown on the site.

What's stopping you from using Warp's plugins?