Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

phpMick's avatar
Level 15

Label Printing

Hi,

I need to print to a networked Datamax label printer using PHP (Laravel). I have no idea where to start, can someone please point me in the right direction?

Mick

0 likes
9 replies
SaeedPrez's avatar

As far as I know, a website can't send raw data to a printer, unless you have some browser plug-in or maybe Java-applet. One way around that is to generate PDFs with Laravel and print those. You can add JavaScript to the PDFs so they auto-print when you open them.

You can then start Chrome with --kiosk-printing and also --kiosk (optional) and it won't show the print preview and instead print directly.

This is for example used for browser-based cash registers.

PS. Make sure you set the thermal printer as default printer.

ohffs's avatar

There are some php drivers for network printers (I guess maybe for use on PoS things). There was someone else asking a few months ago but I can't find the thread now :-/ I think most thermal & label printers have a fairly simple ASCII wire protocol so you might have to do some digging (maybe even something like wireshark/ethereal) to grab it if there isn't anything obvious.

Having a look for a CUPS driver might also help.

Edit: I think this is the thing that came up in the previous thread : https://github.com/mike42/escpos-php Doesn't support the datamax, but might give some ideas...

Npdlink352's avatar

@phpMick Not sure if you ever completed your code for label printing to DATAMAX printers. I use a different method to print to my DATAMAX printers since they are not networked. I created a stand alone program that runs as a service on windows computers and then I store the printable data on a file in the download directory of the computer when ever they click a button. The stand alone program picks it up and sends to the printer port of the computer.

If by any chance you can, I would like to see your end result code as I can make use of it. If you would like to see what did, I would be happy to share.

Thanks.

AzharAbbas's avatar

I want to print label with Labelwriter 450 how can i do that?

Please or to participate in this conversation.