简体   繁体   中英

PHP_Printer From LAMP Server

I am dying trying to figure this out. Googled my heart off with no luck.

I am making a web application to print labels and it should be done through the browser. My webserver is LAMP so I cannot use the PHP_Printer because that is windows based.

Is there an alternative PHP solution for printing from a LAMP server to the client. (ie: Online server is LAMP and they will run the web app through their browser and will be printed to the clients printer).

Thanks for any help!

EDIT So this turned out to be harder than expected. My solution is going to be to use http://www.fpdf.org/ to create a PDF using the user submitted variables. And I will add custom js to the pdf to print without dialogue box as soon as it is opened.

Workflow: User submits stock variables (Qty, Product Number) [Submit] -> Stock added to DB and PDF gets generated and auto printed for the label.

So here is my solution to the problem. I found it in another post here Can a PDF file's print dialog be opened with Javascript?

I will generate a PDF for the labels using FPDF and then add a script to auto print the pdf when its opened.

Script: http://www.fpdf.org/en/script/script36.php

Thanks for helping me think this through guys

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM