Does anybody have experience with printing from a web page?
I have some preprinted papers. On those papers there are some checkboxes that have to be checked based on data that has been filled-in via a webform or called from a MySQL database.
All of this data is available from a PHP web application. Now I am searching for a solution to print this data on my preprinted documents.
So I have to print some crosses on these documents that are located at a specified position.
Does anybody have an idea and an example of how to handle this?
If you want to print all the contents of a webpage as same, you should use php fpdf library.I have developed a website where I needed to print all contents of a form as same.And fpdf was an effective solution. You can get all the supports, downloads and tutorial at http://www.fpdf.org
You should probably generate PDFs that the user can download and print.
The browsers render HTML pretty different when printed. You need fine control over the positioning on the page to fit the output to preprinted paper.
I have zero php experience, but a google search for php generate pdf looks promising. See also this SO search.
I've created similar system (automated printing all the way to printer after click on a web page) with PHP, FOP (http://xmlgraphics.apache.org/fop/) and CUPS (http://www.cups.org/).
I too suggest using PDF for formatting as the alignment seems to be critical in your needs.
If I did such a system now, I'd probably use fPDF (http://www.fpdf.org/) and then use either system call or some kind of job queue (Gearman etc) to print the file to network printer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With