Hello.
I need help getting a page to print correctly with php.
I have a php script that displays the current invoices from a small shop on to the screen but, when I send to to print by pressing ctrl-p it prints the page with a border around the whole page. Also, if I only one to print one invoice, it prints but, again prints with the border around the page. These invoices are 8 1/2 by 5 1/2 (half of page). I'm trying to print them with an Epson lx 300 printer and I'm not getting the desire output. I don' t know if is the printer which I doubt, I've printed it on different printer it same result.
How can I get a page printed with php? or any other way?
Please help. Part of the script below.
Thanks in advanced for your help.
echo "<style><!-- .l { float: left; } .r { float: right; }//--></style>";
echo "<table bgcolor='#ffffff' width='100%' align='center' border=0><tr><td>"; // used to make bg white
echo "<table bgcolor='#ffffff' width='100%' align='center' border=0>" .
"<tr><td align='center'><strong>" . COMPANY_NAME . "</strong></td></tr>" .
"<tr><td align='center'>" . COMPANY_ADDRESS . "</td></tr>" .
"<tr><td align='center'>" . COMPANY_PHONE . "</td></tr>" .
"</table><br>";
echo "<table bgcolor='#ffffff' width='100%'>" .
" <tr><td><!-- Client information --> ".
" <table border=0> " .
" <tr><td>" . $cust_row["customer_id"] . "</td></tr>" .
" <tr><td>" . $cust_row['customer_fname'] . " " . $cust_row['customer_lname'] . "</td></tr>" .
" <tr><td>" . $cust_row['customer_address1'] . "</td></tr>" .
" <tr><td>" . $cust_row['customer_address2'] . "</td></tr>" .
" <tr><td>" . $cust_row['customer_city'] . "</td></tr>" .
" </table>" .
"</td><!-- Client information ends -->" .
"<td valign=middle align=center><table bgcolor='#ffffff' cellpadding='6' class='topBotBorder'><tr><td>FACTURA</td></tr></table></td>" .
"<td valign=top><!-- Invoice information -->" .
" <table bgcolor='#ffffff' cellpadding=2 class='r'>" .
" <tr><td>No. Factura</td><td>:</td><td>" . $inv_row['inv_id'] . "</td></tr>".
" <tr><td>Fecha</td><td>:</td><td>" . $inv_date . "</td></tr>";
while( $dev_row = mysql_fetch_array( $dev_result ) ){
echo " <tr><td>MAC</td><td>:</td><td>" . getMacDisplay( $dev_row['eq_mac_address'] ) . "</td></tr>";
}
echo " </table>" .
"</td></tr>" .
"</table><br>" .
"<table bgcolor='#ffffff' width='100%'>" .
"<tr align='center'><td class='invoice'>Balance Pendiente</td><td class='invoice'>Total del Mes</td><td class='invoice'>Total por Pagar</td></tr>" .
"<tr align=center><td>$ " . $inv_row['inv_prior_bal'] . "</td><td>$ " . $inv_row['inv_amount'] . "</td><td width=30%>$ " . $inv_row['inv_cur_bal'] . "</td></tr>" .
"</table><br><br>" .
"<table bgcolor='#ffffff' class='topBorder' width='100%' align='center'>" .
"<tr align=center><td>Fecha Limite de Pago $due_date</td></tr>" .
"</table><br>";
echo "<table bgcolor='#ffffff' width=100%><tr><td>" . INVOICE_MESSAGE . "</td></tr></table>" .
"<br><br><table bgcolor='#ffffff' width=100%><tr><td>" . $inv_row['inv_timestamp'] . " - $counter" . "</td><td class='topBorder' align='center'> Firma del Cliente </td></tr>" .
"</table>";
echo "</td></tr></table>";