Print data from a web application on pre-printed paper

Does anyone have experience printing from a webpage?

I have ready-made documents. There are some flags in these documents that need to be checked based on data that was filled in via a web form or called from a MySQL database.

All this data is available from a PHP web application. Now I am looking for a solution to print this data on my pre-printed documents.

Therefore, I need to print several crosses on these documents, which are in the indicated position.

Does anyone have an idea and an example of how to handle this?

+6
source share
4 answers

If you want to print all the contents of a web page the same way, you should use the php fpdf library. I developed a website where I needed to print all the contents of the form as such. And fpdf was an effective solution. You can get all the support, downloads, and tutorials at http://www.fpdf.org

+4
source

You should probably create PDF files that the user can download and print.

Browsers display HTML very different when printing. You need subtle control over the positioning on the page so that it matches the output on the pre-printed paper.

I have zero experience with PHP, but google php generate pdf search looks promising. See also this SO search .

+2
source

I created a similar system (automatic printing to a printer after clicking on a web page) using PHP, FOP (http://xmlgraphics.apache.org/fop/) and CUPS (http://www.cups.org/).

I also suggest using PDF for formatting, as alignment seems critical to your needs.

If I made such a system now, I would probably use fPDF (http://www.fpdf.org/) and then use either a system call or some sort of job sequence (Gearman, etc. ) to print the network printer file.

+2
source

Printing well with the pdf option is fine :)

-1
source

Source: https://habr.com/ru/post/916350/


All Articles