Solved

link to File/Pagesetup

Posted on 2006-11-13
10
138 Views
Last Modified: 2010-04-25
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?
0
Comment
Question by:johnhardy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
10 Comments
 
LVL 25

Accepted Solution

by:
Rouchie earned 200 total points
ID: 17931997
No it is not possible unfortunately, and is a very commonly asked question.  If you were hoping to open the Page Setup window because the current design doesn't print very well, then the recommended approach is to use a second print-based style sheet to automatically make the page print differently to how it displays on screen.

This is one of the most popular articles on the internet that provides more of an insight: http://www.alistapart.com/stories/goingtoprint/
0
 

Author Comment

by:johnhardy
ID: 17932553
Thanks I will have a good ;look through that, looks very interesting.

I just wanted to allow a quick change of headers and footers.
0
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 200 total points
ID: 17933154
Hi John,

>> I just wanted to allow a quick change of headers and footers.

Definitely follow Rouchie's advice and use a secondary stylesheet for print view.  You can either embed a second call to a print only stylesheet:

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

or you can add a print definition to your existing stylesheet:

@media screen {

your styles

}

@media print {

your styles

}

I personally recommend using the latter solution.  It keeps your list of files more organized and if an element is supposed to look the same on screen and printed, you just place it outside of the @media calls and it becomes a global style.  When you edit pages in DW, use the View | Style Rendering to flip between the renders and edit the appropriate CSS blocks.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:johnhardy
ID: 17933500
Thanks,

I will come back to this soon

John
0
 
LVL 25

Expert Comment

by:Rouchie
ID: 17936338
Good follow-up Jason.  Not entirely sure why I didn't engage brain to provide an example...!  8-|
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 17940114
Rouchie,

No worries.  You've done that enough times to me when I provide an answer that needs clarification :)
0
 

Author Comment

by:johnhardy
ID: 17946408
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
0
 
LVL 25

Expert Comment

by:Rouchie
ID: 17946746
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" />
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 17949295
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
0
 

Author Comment

by:johnhardy
ID: 17950723
Thanks for the further help, promise I will work on it!
Cheers
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question