Click to See Complete Forum and Search --> : Send frame to a printer


smiley
06-16-2004, 05:25 PM
Hi all,
I have a html & php application deployed on local machines.
This uses Opera in full screen mode.
There are 3 frames.
I would like to be able to send 1 frame to a local printer.
In IE & Mozilla I could use a simple javascript to do this but in Opera it sends the 3 frames to the printer.

Is there some PHP code that will achieve what I need?

Sample javascript that works in IE & Mozilla is below. ('main' is the frame to print.)

function myprint() {
window.parent.main.focus();
window.print();
}

Beach Bum
06-17-2004, 08:49 PM
I don't believe there is any php code that will send to a local printer. PHP is server-side scripting.

smiley
06-17-2004, 09:31 PM
Thanks Beach Bum,
In this case I run the server on the local machine.
The application is run out of a MySql database, Apache, Php & administered with PhpMyadmin - on the local machine.
Php is server side scripting & at present does not seem to be able to do this.
It is just a pity that the javascript for this action does not work in Opera.

MstrBob
06-17-2004, 09:52 PM
Are there many users on your Intranet? Why is it an issue if it's on an intranet? Does it have to be cross-browser friendly if it's local? Why not include a "Printer Friendly Version" if it must be?

smiley
06-18-2004, 12:43 AM
The application sits on the counter of a retail store & contains over 10,000 products - the store has 1,000.
The application is used by the general public & must use Opera for some of the other features Opera offers.
Currently I use a printer friendly of sorts - in 3 actions
1 bust it out of the frames
2 print it
3 use the history - javascript to return.
Could all these be combined in the one comand?

<a href="my_page.php" target="_top" class="myClass">Print - Step 1</a>

<a href="javascript:if (window.print != null) { window.print(); } else { alert('My Alert'); }" class="myClass">Print - Step 2</a>

<a href="javascript:history.go(-1)"> Back
</a>