473,581 Members | 2,908 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Printing a page from ie in landscape when the browser has no menubar

Hi,

Just wondering if anyone can help here. We have a site where most of
the site opens in a window with no toolbars or menubar:
window.open('my page.aspx','sel f','toolbar=0, menubar=0, etc, etc)
This is because it's a data driven site where space is at a premium and
we'd rather discourage use of back, stop and refresh.

The problem arises because some "view data" pages are designed to be
printed and have an onclick="window .print();" button, but the data
tables won't fit properly on portrait A4 (they are designed for
landscape) and there doesn't seem to be any way to default the page
setup to landscape from the html. It seems like an obvious thing to
have - surely the default page layout should be a property of the
document, not the software (as with a word processor).

Getting the user to change the page setup in the parent browser doesn't
help as the child window doesn't inherit the page setup. Some printer
setups will allow setting to landscape from a "properties " button in
the print dialogue, but that's printer specific. The page setup is the
obvious place to set the orientation.

Does anyone know of a way to do this? Obviously I'd prefer something
non-browser-specific, but all our users are on ie 5.0+ so anything for
ie would be better than nothing.

Thanks for any help anyone can offer.

Cheers,

Tim

Jul 24 '05 #1
6 19606
Having read the group's FAQs I'm not sure if this post is o\t or not.
I posted here as the issue seems to possibly include html, javascript,
CSS, ie - and I wasn't sure of another group that might cover all of
the above.

If this is an inappropriate post for this group I apologise, but would
appreciate pointing in the right direection.

Cheers again,

Tim

Jul 24 '05 #2
"Biguana" <te******@yahoo .co.uk> wrote:
Having read the group's FAQs I'm not sure if this post is o\t or not.
I posted here as the issue seems to possibly include html, javascript,
CSS, ie - and I wasn't sure of another group that might cover all of
the above.

If this is an inappropriate post for this group I apologise, but would
appreciate pointing in the right direection.


As you're talking about an IE specific setting (probably an intranet I
guess) then an IE orientated group would give you your best chance.
Probably something in the microsoft hierarchy.

I'm going to finish writing my response from a WWW perspective.

Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Jul 24 '05 #3
"Biguana" <te******@yahoo .co.uk> wrote:
Just wondering if anyone can help here. We have a site where most of
the site opens in a window with no toolbars or menubar:
window.open('m ypage.aspx','se lf','toolbar=0, menubar=0, etc, etc)
This is because it's a data driven site where space is at a premium and
Do the actual end users of the site appreciate this choice? Or would
they rather devote a little bit of space to the basic browser
functions that they can use on every other site? Oh well, an
increasing number of users are using browsers that don't let you
remove the toolbars anyway.
we'd rather discourage use of back, stop and refresh.
Then you should code your application so that it copes gracefully with
such things. You have to do that anyway as those functions are
available to the user via keyboard shortcuts, context menus, mouse
gestures, etc. as well as via the toolbar that you've managed to
remove (sometimes).
The problem arises because some "view data" pages are designed to be
printed and have an onclick="window .print();" button, but the data
tables won't fit properly on portrait A4 (they are designed for
landscape)
So you take away basic browser functions by using JavaScript to open a
new window, and then try to recreate them with more JavaScript only to
realise that you can't recreate them fully.

By the way what happens on your site for users who don't have
JavaScript enabled?
and there doesn't seem to be any way to default the page
setup to landscape from the html.
Nor should there be. HTML is designed for marking up data. It's about
what something is, not about how something is presented in one
particular medium.
It seems like an obvious thing to
have - surely the default page layout should be a property of the
document, not the software (as with a word processor).
But on the WWW you have no idea what printers are connected to your
users machines. Some may not have the ability to print in landscape
mode, some may use paper sizes large enough to fit the print out on a
portrait page, etc.,

CSS 2 had a property, size, that allowed you to suggest the
orientation of the printed page. It was dropped from CSS 2.1 due to
lack of support but something similar will be in CSS 3. None of which
is of any use to you as IE only supports a small amount of CSS.

The CSS 2.1 spec says:
"If a page box does not fit the target sheet dimensions, the user
agent may choose to:
Rotate the page box 90° if this will make the page box fit.
Scale the page to fit the target.
The user agent should consult the user before performing these
operations."

IE doesn't do that either. Some better browsers do to varying degrees
(e.g. I use Opera 8 and it can scale the print out to fit the page).
Getting the user to change the page setup in the parent browser doesn't
help as the child window doesn't inherit the page setup. Some printer
setups will allow setting to landscape from a "properties " button in
the print dialogue, but that's printer specific. The page setup is the
obvious place to set the orientation.
But you've taken the decision to remove access to the page setup
dialogue. You can't have it both ways.
Does anyone know of a way to do this? Obviously I'd prefer something
non-browser-specific, but all our users are on ie 5.0+ so anything for
ie would be better than nothing.


As a user I would overcome the problem as follows (assuming I was
forced to use IE rather than a browser that doesn't allow authors to
switch off access to basic functionality) -
1. Right click on the page and select Properties
2. Select the page URL and copy
3. CTRL+N to open a new browser window
4. Paste URL into the address bar and load page
5. Access Page Setup and Print the page normally.

As an author I see two possible options for you:

1. Review the decision to remove access to basic browser functions.

2. Look for an Active-X control that lets you change the IE page setup
options from with the web page.

Obviously (1) is cross browser whilst (2) is Windows IE only and
relies on your users being willing to take the security risk of
allowing Active-X controls to run.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Jul 24 '05 #4
Steve,

Thanks for a thorough reply. As it happens you're right about the
intranet and unfortunately the decisions about attempting to limit
browser functionality aren't up to me. My first instinct would
certainly be to allow at least the menubar (if for no other reason than
it would solve my problem).

Apologies for not being clearer about the environment - it is
(unsurprisingly ) a work based situation and (for the most part) rather
un-IT-literate users are using the site for data entry. Using the
site's functionality rather than the browser's should (ideally) assist
them, and most users seem to prefer explicit "now click here" type html
buttons than menu options they don't understand, don't use and don't
realise have gone until I point it out (believe me, I'd rather they had
a better understanding of it myself).

I think that "taking away" basic browser functions, and then "trying to
recreate them" could be described as attempting to "limit
functionality", and I'm also not sure I agree about the page layout not
being an appropriate property for the WWW. A word processed document
can also be opened on any PC with any printer, but the author may well
still have an intented page setup for it, where available. The fact
that variations on this theme have been\will be included in CSS
indicates that I may not be entirely alone.

On the subject of javascript, if it's not enabled you can't use the
site (just like if you don't have a computer you can't use the site).

I think what I've done here is explained it's an intranet site and then
responded to the WWW based reply. Oh well.

I may well post this in an ie group as suggested although I don't
imagine the replies will be any more thorough and helpful than your own
(meant sincerely, in case it sounds rude).

Thanks again,

Tim

Jul 24 '05 #5
On 13 Apr 2005 05:42:47 -0700, "Biguana" <te******@yahoo .co.uk> wrote:
I may well post this in an ie group as suggested although I don't
imagine the replies will be any more thorough and helpful than your own
(meant sincerely, in case it sounds rude).


The solution is ScriptX from http://www.meadroid.com/scriptx/

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 24 '05 #6
On 13 Apr 2005 02:22:16 -0700, "Biguana" <te******@yahoo .co.uk> wrote:
This is because it's a data driven site where [bogosity abounds] we'd rather discourage use of back, stop and refresh.
I'd rather encourage it. And as I'm the user who chooses whether I
should go there or not, my choice wins.

The page setup is the obvious place to set the orientation.


You should begin by looking at print-specific CSS. There's an awful
lot you can do with this, such as supressing nav menus on the printed
version. It even works on almost all browsers.

There's useful CSS stuff you can do to control page breaking, which
barely works anywhere. Shame (you should probably still try though)

If you want to control print orientation or margins, then you're a bit
stuck. For an IE/ActiveX world you can do this quite neatly with this:
http://www.meadroid.com/scriptx/
Obviously this is less portable than you'd like, but you can code in
such a way that it doesn't _hurt_ anything that can't use it.

Jul 24 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3004
by: Darcy Kahle | last post by:
I am trying to do some advanced printing in python using the win32ui module, and have run into an issue. I need to print a page landscape. As I could not determine how to specify the orientation of the printing, I arranged the graphic elements on the page the way it should be. When I got to printing text, it went across the page, not down as...
4
4841
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been selected. For example, if I were to have 5 pages with every second page printing, I would get the following results: Page 1 = Print OK Page 2 =...
5
10100
by: Patrick De Ridder | last post by:
How can I turn what I want to print 90 degrees using the logic below? Please tell me the code with which to make the modification. Many thanks, Patrick. using System.ComponentModel; using System.Drawing; using System.Drawing.Printing; using System.IO;
3
31845
by: D Witherspoon | last post by:
No matter what I do the default paper size is always either A3 or 11 by 8.5 .. Here is the code. Dim dlg As DialogResult pd.DocumentName = "Weld Image" Dim pkPaperSize As New Printing.PaperSize("sdfgsfdg", 850, 1100)
2
2848
by: jc_va | last post by:
I need to print a document in landscape mode (using IE6). I see the @page directive, but I can't get it to work. I have searched this forum, but don't see many articles on printing landscape that are relatively recent. Is there still no reliable way to print LS with IE6? That's our company standard, so I can't tell our VPs to change...
2
9943
by: Brad Pears | last post by:
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default printer settings to print. I wanted the print preview to appear the same for all users (i.e. a default page size of 8.5x14 (legal) and portrait...
3
4220
by: Jlcarroll | last post by:
Hi, I am building a web page.and have a simple javascript menu... I call the javascript menu within a div block that my print sytlesheet has set as a display: none;, well all the content in that block doesn't show up, EXCEPT the javascript is still getting run... <div class="menu"> <!--*****************These lines load in the
8
2080
by: Mike P | last post by:
I am trying to use javascript to print my .NET page. I am building up some HTML using a stringbuilder and then using this javascript to try to print it : <input id="Button2" value="Print" onclick="javascript:window.print()"> The page is wider than a standard A4 page but should fit onto a page in landscape view, yet when I try to print in...
7
2558
by: Iain Wilson | last post by:
I am pulling my hair out trying to print various objects from a .net web page My apologies for cross posting but I need an answer and my previous post has attracted no interest. ASP.Net 2.0 using C# This is a simple web page on our intranet (written as a test) and all I am trying to do is print a document to a named printer. If I use a...
0
7882
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7808
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8312
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6564
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3835
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1410
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.