PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 11, 2022

[FIXED] PHP_Printer From LAMP Server

 February 11, 2022     lamp, php     No comments   

Issue

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.


Solution

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



Answered By - cantaffordavan
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing