Solved

Printing invoices with php/mysql

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Downside of adding characters set in ASP pages 6 36
Un-Indent Setting Notepad++ 3 26
Syntax error creating JSON recordset 4 27
calculate days away 11 25
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

749 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