Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Print Preview using JavaScript onClick?

0 views
Skip to first unread message

Kebmo

unread,
Oct 27, 2005, 8:55:26 AM10/27/05
to
The client insists on having a link or button that the user can click
to view the printable version in the browser. I already have the css
done for the print version, so thats not a problem. I don't want to
create duplicate pages if I can help it (I anticipate many updates as
the months go by, and I don't want to have to do double the work).

I know I have seen this functionality before, but I can't seem to find
it now. Is there existing script to open the print preview pane with an
onClick?

Any help is greatly appreciated.

Kebmo

VK

unread,
Oct 27, 2005, 9:01:21 AM10/27/05
to

In the document <head> : (no JavaScript needed)

<link rel="stylesheet"
type="text/css"
media="all"
href="stylesCommon.css">
<link rel="stylesheet"
type="text/css"
media="screen"
href="stylesBrowser.css">
<link rel="stylesheet"
type="text/css"
media="print"
href="stylesPrint.css">

Kebmo

unread,
Oct 27, 2005, 9:09:01 AM10/27/05
to
Thanks. I have this sort of setup already. When the user prints the
page, it uses the print-only styledsheet I made for that purpose.

What I need is to be able to click a link or button and open the Print
Preview pane just as if I had gone to file-->print preview.

Is this even possible?

Evertjan.

unread,
Oct 27, 2005, 9:20:49 AM10/27/05
to

Using serverside jscript unser ASP:

<%@ Language=JScript %>


<link rel="stylesheet"
type="text/css"
media="all"
href="stylesCommon.css">

<link rel="stylesheet"
type="text/css"
media="screen"

<% ' ASP Jscript
if(request.querystring('print')=='yes'){
%>
href="stylesBrowser.css"
<%
}else{
%>
href="stylesPrint.css"
<%
};
%>
>

<link rel="stylesheet"
type="text/css"
media="print"
href="stylesPrint.css">

......

<a href='?print=yes'>Print preview</a>

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

rf

unread,
Oct 27, 2005, 9:23:41 AM10/27/05
to
Kebmo wrote:

> The client insists on having a link or button that the user can click
> to view the printable version in the browser.

Teach your client how to use File>Print Preview. Then she will stop wanting
that.
--
Cheers
Richard.

Evertjan.

unread,
Oct 27, 2005, 9:27:55 AM10/27/05
to

Or let them use Fineprint.

<http://www.fineprint.com/>

D. Patterson

unread,
Nov 3, 2005, 6:28:10 PM11/3/05
to
Another option (the one that I use) is MeadCo's ScriptX ActiveX object.
They also have a way to make it (and pretty much any other ActiveX object)
work with other browsers.
Check out http://www.meadroid.com/scriptx/about.asp
Dave

"Kebmo" <imagog...@gmail.com> wrote in message
news:1130417726....@g49g2000cwa.googlegroups.com...

0 new messages