Link to home
Start Free TrialLog in
Avatar of johnhardy
johnhardyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

link to File/Pagesetup

By the inclusion of the following tag I can go directly to the print routine

<a href="#" onClick="window.self.print(); return false;">Print</a>

Is it possible to go to File > Page Setup instead?

I tried <a href="#" onClick="window.self.setup(); return false;">Print</a>
and
<a href="#" onClick="window.self.pagesetup(); return false;">Print</a>

without success.

Any ideas please?
ASKER CERTIFIED SOLUTION
Avatar of Rouchie
Rouchie
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of johnhardy

ASKER

Thanks I will have a good ;look through that, looks very interesting.

I just wanted to allow a quick change of headers and footers.
SOLUTION
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks,

I will come back to this soon

John
Good follow-up Jason.  Not entirely sure why I didn't engage brain to provide an example...!  8-|
Rouchie,

No worries.  You've done that enough times to me when I provide an answer that needs clarification :)
Thanks very much for the help.

I am getting there OK gradually.

I didnt understand Jasons @media screen answer and dont have the time right now to persue this.

Anyway Thanks again John
Although I don't use this approach, I believe this means

@media screen {
  h1 {font-size:20pt; color:#ff0000;}
}

@media print {
  h1 {font-size:12pt; color:#0000ff;}
}

that the above code will print H1 headers in blue, but display them in red on the screen, with different font sizes too.  It allows you to specify BOTH sets of appearances in the same style sheet.

My approach is to create 2 stylesheets, one for screen and one for print.   They each contain the same style names but with different formatting for each.  I link both sheets in as follows (again borrowing from Jason's answer)...

<link href="../printstyle.css" rel="stylesheet" type="text/css" media="print" />
<link href="../screen.css" rel="stylesheet" type="text/css" media="screen" />
John,

Rouchie explains my answer correctly.

There isn't a whole lot of difference between the two solutions.  I just prefer to have one file instead of two (or three, if I'm also designing for a handheld) whenever possible.

Thanks for the assist.

J
Thanks for the further help, promise I will work on it!
Cheers