laravel-printing
laravel-printing copied to clipboard
Content() dont work
Laravel Printing Version
v3
Laravel Version
v8
Bug description
I can print pdf file but i want print text content() dont work . $printerId = '71387975';
$text = (string) (new ReceiptPrinter) ->centerAlign() ->text('My heading') ->leftAlign() ->line() ->twoColumnText('Item 1', '2.00') ->twoColumnText('Item 2', '4.00') ->feed(2) ->centerAlign() ->barcode('1234') ->cut();
Printing::newPrintTask()
->printer($printerId)
->content($text)
->send();
Steps to reproduce
.
Relevant log output
.
Hello, I am having the same problem. Did you solve it?
When using content() method you can specify the content type with the 2nd parameter. Depending on your used driver you can find the available content types in Printing/Drivers/
Example hardcoded:
Printing::newPrintTask()
->printer($printerId)
->content($text, 'text/plain')
->send();
or in my case loading with a different name:
use Rawilk\Printing\Drivers\Cups\ContentType as PrintingCUPSContentType;
Printing::newPrintTask()
->printer($printerId)
->content($text, PrintingCUPSContentType::TEXT)
->send();
I can't see anything from your code that would be preventing it from working. If your PrintNode account (if you're using that driver) is receiving the job, then it should be working properly.
This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.