?
Solved

Printing invoices with php/mysql

Posted on 2003-10-24
4
Medium Priority
?
570 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
ethrbunny earned 1500 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

752 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