Solved

link to File/Pagesetup

Posted on 2006-11-13
10
134 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
 

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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

13 Experts available now in Live!

Get 1:1 Help Now