Solved

link to File/Pagesetup

Posted on 2006-11-13
10
136 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
  • 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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 …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

816 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now