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

Placid's avatar

PHP directly print to printer

Hello,

My organization uses a web application built with PHP that prints barcodes and other formatted stuffs directly to printer. The PHP version used is 5.2.6 that has php_printer.dll extension which enables the program to print directly to printer.

Now, the management wants me to rebuild the app and I am very interested to create it using Laravel latest version which requires PHP version >= 5.6.4. But the php_printer.dll extension is not available for these versions.

I found the extension which mentions it supports 5.6.8 (https://github.com/gimjudge/php) but it does not work. I have tested with PHP 5.6.25 and 5.6.8.

So, what are my options here?

  • Am I stuck with older version of PHP because of this single issue?
  • I am self learned web developer without CS degree. I don't know C language. So I cannot create the .dll extension myself. Do I have to learn the whole process? How long might this take?
  • Can I hire someone to take the extension for the old version and create a new one for the latest version of PHP? How long may this take and how much may this cost?

Any insights is highly appreciated. Thanks

0 likes
11 replies
SaeedPrez's avatar

Hi @Placid

Last project I worked on that needed to print, I created PDFs containing this.print() JavaScript so the PDF would print automatically upon opening coupled with Chrome's kiosk printing option..

https://mycartpos.zendesk.com/hc/en-us/articles/200868343-Enable-kiosk-printing-print-automatically-for-Google-Chrome-on-Windows

I would then open the PDFs in a hidden <iframe> if I don't recall poorly, and it would print without the user seeing any PDF or print preview.

3 likes
Placid's avatar

Hi @SaeedPrez, thank you so much for your kind suggestion. I will try it.

In your experience with these tools, is it possible to start a page, print something, end the page and start again. I am asking this because I need to print barcodes to barcode printer, for which I need to start and end the pages for barcodes to print on each barcode sticker.

Thank you again.

SaeedPrez's avatar

@Placid

I printed hundreds of receipts at a time to a thermal printer, I created a PDF with X pages and each page was one receipt.

1 like
fahadkhan1740's avatar

hi @SaeedPrez, the link you mentioned is no longer available. Can you please provide any other resource in this regard? Thanks in advance.

Please or to participate in this conversation.