Solved

Printing invoices with php/mysql

Posted on 2003-10-24
4
545 Views
Last Modified: 2006-11-17
Hi I'm developing a customer system with php and mysql, but i need to print invoices not in a lasser or inkjet printer but on impact (matrix) printer, and manipulate by strings (i guess) the output to use pre printed forms

I saw using javascript can do it, or with microsoft templates, but both are using a laser printer

Can someone help me with this thing telling me how can i do it?

thanks

Regards
0
Comment
Question by:Alejandro_Lopez
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
ethrbunny earned 500 total points
ID: 9616311
The type of printer you ultimately output to is irrelevant here. What has worked for me in the past is to output your data into a popup window with a 'print' button and add a form button like

<input type='button' value='Print' onClick='window.print();'>

Since you are printing onto a preexisting template getting the correct layout of the information is the critical part. Using tables and a good style sheet will get you the output you want.
0
 

Author Comment

by:Alejandro_Lopez
ID: 9617538
Good way to solve the problem, i just tried and work fine (depending on the installation of the printer generic text or driver) but it is related to IE, and i'm just trying not to depend on any browser feature or plattaform. Don't you know any javascript solution??

thanks
0
 
LVL 1

Expert Comment

by:ethrbunny
ID: 9617569
The 'window' object is just javascript. Its not IE dependant. Neither is the <INPUT> element.
0
 

Expert Comment

by:clayroad
ID: 9626076
The question is whether you want to print to a printer attached to a server or attached to the client....

If you need to print an invoice clientside, you should probably use the window.print() function of JavaScript. You can't avoid the 'select printer' popup here. Another option might be a Java-applet (should be platform independant), although I'm not sure about that.

If you need to print an invoice serverside, you can use PHP printer functions (see http://www.php.net/printer). This probably works for network printers as well, as long as the printer has been defined on the server.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Read about why website design really matters in today's demanding market.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question