Add Printjs to infolist action

Hi, in my app i have an infolist with a button 'print'
 
#PRINT INVOICE
                            Action::make(__('repair.print'))
                            ->action(fn ($data, Repair $record) => redirect()->to(
                                route('repair.pdf.'.$data['type'], $record)
                            ))
                         
                            ->icon('heroicon-s-printer')
                            ->form([
                                Forms\Components\Radio::make('type')
                                    ->label('')
                                    ->default('receipt')
                                    ->options(PrintOptions::class)
                                    ->disableOptionWhen(function (string $value, Model $record) {
                                        return $value === 'aggregate' && $record->parts === null || $value === 'regular' && $record->parts === null;
                                    })
                            ])

this action all a route that generate and show a pdf in the browser (same tab)
now i want to add printerjs in order to print it directly

i've added print js with npm
import in app.js
compiled with npm run build
and inspecting the code, the library seems to be loaded right

now
Was this page helpful?