I am unable to find any post which has answer to my issue.
I have html file which has a table, need to convert this to a text file without losing the format USING php script, as it has to be printed as is on a dotmatrix printer.
OR if there is any other way of doing this, pl suggest !
The table is a Invoice format, pl see below:
<table width='100' height='300' border='0' cellspacing='0' cellpadding='1'> <tr> <td><img src='spacer.jpg' width='100' height='1'></td> <td><table width='840' border='1' cellspacing='2' cellpadding='0'><tr><td width='660' colspan='2' valign='top'><br><br><br><br><br><br><br><br><br>Customer Name: 3M India Ltd<br>
Address:Plat 48-51 Electronic City<br><br></td><td width='180' valign='top'><br><br><br><br><br><br><br><br><br>
Inv No: 78788<br><br>Date: 20/04/2012 12:28:18<br><br>
</td> </tr> <tr> <td width='292' valign='top'>DC Nos: 500, <br><br></td><td valign='top'> Your Order No.: 322<br>
C.E.Reg No.: <br>
Vehicle No.: KA-01-N-2345<br><td valign='top'> Party:<br>
TIN: 29400127541<br>
CST: 29400127541<br></td> </tr> <tr> <td colspan='2'>Sl No. Description Tariff Code Rate Qty </td> <td>Amount</td> </tr> <tr> <td colspan='3'> <table width='840' height='160' border='0' cellspacing='1' cellpadding='0'> <tr valign='top'> <td width='87'>1</td> <td width='247'>Argon</td> <td width='165'>AR1223</td> <td width='92'>120</td> <td width='67'>1 Nos</td> <td width='182'>120.00</td> </tr> </table> </td> </tr> <tr> <td colspan='2' valign='top'><div align='right'><br>VAT: 5.00 %<br>Demurrage: <br> Freight: <br><br> </div>Rupees Four Hundred & Fourty One Only.</td><td valign='top'><br> 21.00<br> 0.00<br> 300.00<br><br> </td> </tr> <tr> <td colspan='2' valign='top'><div align='right'>Total:<br><br>Rounded Off</div></td> <td valign='top'>441.00<br><br>441.00<br><br></td> </tr></table> </td> </tr></table>
Could you not open the HTML file in something like Microsoft Word and then send it to print?
You could also convert the HTML file to PDF, there's several free ones (Google "html to pdf conversion") as another option to see if it works.