Skip to content
New issue

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

Error on Batch printing #17

Open
Xelosy opened this issue Jul 26, 2022 Discussed in #16 · 0 comments
Open

Error on Batch printing #17

Xelosy opened this issue Jul 26, 2022 Discussed in #16 · 0 comments

Comments

@Xelosy
Copy link

Xelosy commented Jul 26, 2022

Discussed in #16

Originally posted by Xelosy July 20, 2022
Hi i get the following error on Batch Printing:

Fatal error: Uncaught ErrorException: fwrite(): send of 8192 bytes failed with errno=10035 A non-blocking socket operation could not be completed immediately. in C:\inetpub\wwwroot\Intranet\Label\vendor\php-aidc\label-printer\src\Connector\NetworkConnector.php:69 Stack trace: #0 C:\inetpub\wwwroot\Intranet\Label\vendor\php-aidc\label-printer\src\Connector\NetworkConnector.php(71): PhpAidc\LabelPrinter\Connector\NetworkConnector->flushErrors() #1 C:\inetpub\wwwroot\Intranet\Label\vendor\php-aidc\label-printer\src\Printer.php(40): PhpAidc\LabelPrinter\Connector\NetworkConnector->write('SIZE 50 mm,25 m...') #2 C:\inetpub\wwwroot\Intranet\Label\Label.php(466): PhpAidc\LabelPrinter\Printer->print(Object(PhpAidc\LabelPrinter\Label\Batch)) #3 {main} thrown in C:\inetpub\wwwroot\Intranet\Label\vendor\php-aidc\label-printer\src\Connector\NetworkConnector.php on line 69

My Code:

'''
$batch= (new Batch());
foreach ($_POST as $key => $value) {
$label = Label::create(Unit::MM(), 50, 25); //Unit, Width, Height
$label->charset(Charset::UTF8());
$label->add(new Clear());
$label->add(new Raw("DENSITY " . $temp));
$label->add(Element::textLine(($xFactor * 10), ($yFactor * 10), $current, 'arial.TTF', 25)); // x, y , text, font, size
..... much more $label->add( some elements) ......
$batch->add($label);
}
$printer->print($batch);
'''

Its working for a few labels and then the error message from above appears. Is there a problem how i create the label in the foreach loop?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant