Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printing data from a web application on preprinted paper

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?

like image 379
mario Avatar asked May 22 '12 11:05

mario


3 Answers

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

like image 60
Kaidul Avatar answered Nov 14 '22 20:11

Kaidul


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.

like image 42
codeape Avatar answered Nov 14 '22 20:11

codeape


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.

like image 2
geekuality Avatar answered Nov 14 '22 21:11

geekuality