Click to See Complete Forum and Search --> : $25.00 for script
Steveorso
12-21-2002, 04:23 PM
I know it's probably too simple for most of you to waste your time, so someone, actually I'm willing to pay the first one that gives me a working script $25 via paypal.
I'd like to print a single gif or jpg from a button/text link The closest script I've found prints the whole page.
<A HREF="javascript:window.print()">Click to Print This Page</A>
I have a coupon in a .gif format on a page and want to create a print coupon button - say valvoline.gif directly to the printer?
Steveorso needs help
:(
Here's one way to do it.
Add this to the <head> of the page you want to be able to print the cupon from.
<script language="JavaScript">
<!--Hide
function opencupon()
{
var url = "popup.htm";
var name = "popup";
var windowproperties = "width=430,height=240,left=2000,top=2000,screenX=2000,screenY=2000,location=no,toolbar=no,menubar=no, scrollbars=no,resizable=no";
window.open(url, name, windowproperties);
}
//End Hide-->
</script>
Add this to the <body> of the page you want to print the cupon from.
<A HREF="javascript:opencupon()">Print Cupon</A>
Now, make a HTML page with the following code. Note: edit the <img src> tag to reflect the img you want to print.
<html>
<head>
<title>Cupon</title>
</head>
<body onLoad="javascript:window.print(); window.close()">
<img src="cupon.gif" width="400" height="200">
</body>
</html>
What this does is opens a window with your cupon in it, positions the window so it isn't visible, prints the image and closes the window. Not the best way to do it, but it might be the only way...
The var windowproperties all needs to be on one line...These forums just split it.
khalidali63
12-21-2002, 07:32 PM
BTW
which software you guys use that prints
<A HREF="java script:opencupon()">Print Cupon</A>
because I don't know if there is anything that goes by the name of
java script,of course, there are Java programming language and SavaScript scriptiing language..just thought set the record straight..:-)
It is supposed to be <A HREF="javascript:opencupon()">Print Cupon</A>. Yet another formatting mess up by the forums.
Steveorso, if you want me to email this to you, I can do that, just give me an email address. I don't know if the forums messed up any more of the code...