|
Posted by Erwin Moller on 08/07/06 08:17
weetat.yeo@gmail.com wrote:
> Hi all ,
>
> I have php page which the data in the page are extracted from MYSQL
> database.
> The data are retrieved when user click submit button .
> In the php page , there is a print button for user to print the php
> page.
> Presently, i am using javascript window.print() which not an elegant
> option.
>
> I tried to use CSS for printer friendly in php page , however i did not
> know how to start.
> Anyone have any idea how to , please share it with me .
>
> Thanks
> - weetat
Hi Weetat,
I always solve this the simple way:
1) Make a button: "Printer friendly page"
2) If somebody hits that button, simply create a popupwindow in which you
retrieve the data again, and display it with little/no colors, just black
and white.
From there you can call window.print() safely.
Alternatively, you can make a stylesheet for the printer, and tell the
browser to use that (without the popupwindow). That should work too, but I
prefer the first option because the user can see what will be printed
beforehand excactly.
just my 2 cent.
Regards,
Erwin Moller
[Back to original message]
|