cantaffordavan
cantaffordavan

Reputation: 1447

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.

Upvotes: 1

Views: 1693

Answers (1)

cantaffordavan
cantaffordavan

Reputation: 1447

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

Upvotes: 1

Related Questions