/    Sign up×
Community /Pin to ProfileBookmark

$25.00 for script

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
?

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@pyroDec 21.2002 — 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.

<i>
</i>
&lt;script language="JavaScript"&gt;
&lt;!--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--&gt;
&lt;/script&gt;


Add this to the <body> of the page you want to print the cupon from.

<i>
</i>&lt;A HREF="javascript:opencupon()"&gt;Print Cupon&lt;/A&gt;


Now, make a HTML page with the following code. Note: edit the <img src> tag to reflect the img you want to print.

<i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Cupon&lt;/title&gt;
&lt;/head&gt;
&lt;body onLoad="javascript:window.print(); window.close()"&gt;
&lt;img src="cupon.gif" width="400" height="200"&gt;
&lt;/body&gt;
&lt;/html&gt;


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...
Copy linkTweet thisAlerts:
@pyroDec 21.2002 — The var windowproperties all needs to be on one line...These forums just split it.
Copy linkTweet thisAlerts:
@khalidali63Dec 22.2002 — 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..:-)
Copy linkTweet thisAlerts:
@pyroDec 22.2002 — 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...
×

Success!

Help @Steveorso spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...