Connecting Tech Pros Worldwide Forums | Help | Site Map

Print Preview using JavaScript onClick?

Kebmo
Guest
 
Posts: n/a
#1: Oct 27 '05
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


Kebmo
Guest
 
Posts: n/a
#2: Oct 27 '05

re: Print Preview using JavaScript onClick?


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?

VK
Guest
 
Posts: n/a
#3: Oct 27 '05

re: Print Preview using JavaScript onClick?



Kebmo wrote:[color=blue]
> 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[/color]

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">

Evertjan.
Guest
 
Posts: n/a
#4: Oct 27 '05

re: Print Preview using JavaScript onClick?


Kebmo wrote on 27 okt 2005 in comp.lang.javascript:
[color=blue]
> 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?[/color]

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"
<%
};
%>[color=blue]
>[/color]

<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
Guest
 
Posts: n/a
#5: Oct 27 '05

re: Print Preview using JavaScript onClick?


Kebmo wrote:
[color=blue]
> The client insists on having a link or button that the user can click
> to view the printable version in the browser.[/color]

Teach your client how to use File>Print Preview. Then she will stop wanting
that.
--
Cheers
Richard.
Evertjan.
Guest
 
Posts: n/a
#6: Oct 27 '05

re: Print Preview using JavaScript onClick?


rf wrote on 27 okt 2005 in comp.lang.javascript:
[color=blue]
> Kebmo wrote:
>[color=green]
>> The client insists on having a link or button that the user can click
>> to view the printable version in the browser.[/color]
>
> Teach your client how to use File>Print Preview. Then she will stop
> wanting that.
>[/color]

Or let them use Fineprint.

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

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

D. Patterson
Guest
 
Posts: n/a
#7: Nov 3 '05

re: Print Preview using JavaScript onClick?


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" <imagographics@gmail.com> wrote in message
news:1130417726.328931.37680@g49g2000cwa.googlegro ups.com...[color=blue]
> 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
>
>[/color]


Closed Thread