Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print checks and custom forms with PHP

I have been working on a web based financial manager application that is written almost exclusively in php. I would like to be able to allow users to enter and print checks to their check stock.

My first thought was that I could use something like FPDF to create a .pdf document that is the correct size and places the data (date, amount, english text amount, vendor name) in the correct location. That works fine.

The problem I have is that when I go to print a 4.5" x 2.75" document (size does matter), Adobe Reader (browser pluggin and Windows version) places the document on the users available printer pages. Printers do not come with preset page sizes to it all the possible personal check sizes, and not all printers will allow users to add page sizes to the printer driver (yes you can add forms to windows through the print server; but they may or may not show up a an available form in the print driver).

I have read A LOT online on how to create custom form / documents, but am not getting my problem resolved. So I guess I am looking for suggestions on how to implement check printing from within my web app would be greatly apprecated.

like image 717
Lance Abshier Avatar asked Nov 15 '12 18:11

Lance Abshier


1 Answers

You can try to run Cups server with your check printers connected to it. Cups server communicates with it's clients over IPP protocol.

You can create IPP printing job right from php using http://www.cups.org/articles.php?L545+TNews+Q

Printing jobs have attributes - media size is one of them.

So, this way user's OS won't print anything. User will just POST some query to http server, and php will create print job for cups server with media-size and some other attributes.

like image 178
Oroboros102 Avatar answered Nov 17 '22 01:11

Oroboros102