Solved

Printing invoices with php/mysql

Posted on 2003-10-24
4
535 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

747 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now