Partager via


Ease the Pain with IE6 Printing

The information published in this post is now out-of-date and one or more links are invalid.

—IEBlog Editor, 21 August 2012

Before we start let me shortly introduce Adrian Bateman. He is the developer
currently working on our IE7 print experience. Since he works out of Microsoft's
offices in Reading, England, we are much better now at printing “tomatoes”.
Without further ado:

Today, there is a well known problem with
printing from Internet Explorer where the layout of the page sometimes
causes content to be cropped if it doesn't fit into the width of the paper.
We are working hard to improve printing in IE7 but we'd like to share some
approaches to ease the pain when printing with IE today.

First of all, content authors creating web
pages can change the layout of their pages when printing using the
CSS
@media rule
.
This allows you to specify CSS attributes that get applied based on whether
the page is displayed on screen or printed to paper. You might, for example,
choose to turn off menus, logos, and side content by setting the appropriate
areas to display: none when printing.

Example:

@media print {

#menu, #logo, #sidebar {display: none; }

}

If you want to print web pages from someone
else's site then you have a few options. Using the built in functionality,
you may be able to adjust the size of the margins used when printing to make
the content fit. You can do this by picking File, Page Setup from the menu
or using the Page Setup button from within Print Preview. Many people set
their page orientation to landscape when printing wider pages and in this
aspect ratio, most pages will print correctly. Remember that Print Preview
will give you an accurate indication of what will be printed and allow you
to see if the page will be cropped.

Often, you only really want to print part of a
page. You don't need the adverts, navigation, and layout. If you select part
of a page, you can right-click and choose Print and then choose the Page Range
radio button for "Selection". This will print just the area of the page
you've selected.

If you want to take the hassle out of printing
or if the suggestions above don't work on the pages you need to print, there
are several Internet Explorer add-ons that help:

As I indicated, printing and the print preview
experience are amongst the areas we are improving in IE7. Our goal is to be
able to print most web pages without losing any content using the default
settings. For pages where this is impractical, we want to provide you with
simple controls within print preview so that you can quickly and easily
adjust the settings needed to print the way you want. We're still finalizing
the details of the new functionality for printing but I will post an update
once we get it locked down.

-- Adrian Bateman and Markus Mielke

Comments

  • Anonymous
    January 01, 2003
    I've seen so many bugs on print preview (not just in IE, but in all apps) that I wish there was a system-wide print-to-pdf utility (like OS X's Preview)

    Wouldn't you guys rather work on something sexier than print preview? IIRC IE 5.0 didn't even have print preview.

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    Nice to hear this is getting worked on, its something that's bugged me for a while now.

  • Anonymous
    January 01, 2003
    How does it compare to Opera's MSR rendering? Opera 8 really utilizes its advanced CSS and does great job with fit-to-width for screen and print.

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The other thing about printing in IE that has always bothered me is that you cannot do a Print Preview of a selection. Hopefully that will be possible in IE 7.

  • Anonymous
    January 01, 2003
    Are there any plans to support setting page margins in a page? HTML could be used for a lot of quick reporting and nice print layouts, except there's no way to force a certain page margin.

    There's supposedly a "@page" CSS rule for setting page size and properties, although I've never been able to get it to work in IE or Firefox (I'm not sure about Opera).

    This could also turn ASP/ASP.NET into a pretty powerful reporting tool. It would also reduce the need for PDF files, which have accessibility problems.

  • Anonymous
    January 01, 2003
    So what? I thought that was one of the fundamentals of CSS...

  • Anonymous
    January 01, 2003
    TheMuuj - "Are there any plans to support setting page margins in a page?"

    As an author you can do this - and a great deal more - with ScriptX (linked from my name). Proven over 7 years (since IE4) and these days the de facto printing enabler for IE on millions of client boxes.

    Markus knows all that, he just forgot to list it.

  • Anonymous
    January 01, 2003
    I'd like there to be a feature in Explorer to turn on print preview functionality in the browser itself such that I wouldn't have to continually refresh and open the print preview window, to make developing print styles easier. A switch of the media rule from screen to print as it were, so that I could view documents in the browser itself as they would be when printed (and still be able to navigate links in the document).

    Perhaps part of an "alternative stylesheet" implementation, where among the alternative styles are also the different media style sheets. Opera can do this with handhelds via the small screen feature. Be nice to see this in IE as well, in addition to being able to switch to the other media types.

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The Muuj ~ you're right up to a point, but there's a level beyond which you can't offer every anonymous publisher of web-based content the ability to (say) promptlessly print 1,000 copies of a document onload that doc, or apply any sort of custom print template to browser-based content ... and I can keep going here ... without some form of unambiguous accountability.

    Beyond a basic set of 'free' functionality, ScriptX provides a huge amount of useful and well-proven print-enhancing capability which - just as with a number of other tools that leverage IE and/or WebBrowser - it would be entirely inappropriate for MSFT to attempt to 'embrace' into the base browser product.

    Investigate ScriptX and you'll see what I mean.

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    make sure printing plays nice with tranparent pngs and with mng/svg if you have the courage to implement them

    peace

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    TheMuuj ~ "I don't see why an ActiveX control and Javascript or advanced server-side rendering are required to transform a simple HTML document into a good looking printed document."

    I'm sure you're right. But while we're waiting, what you want is do-able now on every version of IE from 4.01SP1 onwards, with a 'basic' subset of control of margins, header, footer and orientation available from 'free' ScriptX.

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    It would be nice if Explorer (or any other browser for that matter) actually print what the page displays! An example:

    The Browser window renders as:
    i i i i i i i i i i i i
    i i i i i i i i i i i i
    i i i i i i i i i i i i
    i i i i i i i i i i i i
    i i i i i i i i i i i i
    i i i i i i i i i i i i


    While the Print Preview window renders as:
    i i i i i i i i i i i i i
    i i i i i i i i i i i i i
    i i i i i i i i i i i i i
    i i i i i i i i i i i i i
    i i i i i i i i i i i i i
    i i i i i i

    I've posted an articel in the newsgroups, but so far no one was able to answer this trivial question.

    See: http://groups-beta.google.com/group/microsoft.public.windows.inetexplorer.ie6.browser/browse_frm/thread/52ef7790d2e279fc/40af66e43ba8f12c?tvc=1&hl=en#40af66e43ba8f12c

  • Anonymous
    January 01, 2003
    As well as the width issues, it would be great if page breaks were supported (http://www.w3.org/TR/REC-CSS2/page.html).

    Technically when a text area is split over two pages no content is 'lost', but it still renders the printout unusable.

  • Anonymous
    January 01, 2003
    Hi guys,

    I remember thinking the @media rule was exactly what I was looking for, until I found that IE 5/5.5 (I can't remember which, probably both) decided to ignore the @media rule and render all the 'printer' styles anyway.

    The only sure-fire way to correctly apply stylesheets according to media type is using the media attribute of the link tag.

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    Enough! Please no more!

    I can't take this constant "Well if you don't like our lack of DOM Inspector/Tabs/printing controls/whatever, you can purchase a third party add on!"

    It's ridiculous the number of times you guys refer to third party products in this blog.

    This is the first time I'm aware that the add-ons haven't costed anything.

  • Anonymous
    January 01, 2003
    I too would like SVG printing to be well tested. It seems a little hit and miss in Deer Park and Opera.

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    Please consider how to handle dynamically sized server-generated content.

    We have a web app that sends a page to the client. On the client the page size is read and another request is sent back to the server so an appropriate size image can be generated.

    Because IE currently doesn't re-request a page when printing is initiated, the images often are often truncated. I understand that in many cases not re-requesting the page is preferable, but perhaps there may be some way to accomodate this idea.

    Thanks,

    Jeff

  • Anonymous
    January 01, 2003
    This is definitively a good thing to push for the use of CSS and its @media selector.

    Nonetheless, it doesn't solve some weird issue IE6 have when it comes to floating blocks behind cut by a page-break.
    Given the very poor support of IE6 (and most browsers for that matter) for page-break CSS attribute and sisters, @media print or not, one will still get the second-page part of the floating block to get a margin equal to the width of the first-page part... which is terribly annoying when those are images surrounded by text for instance...

  • Anonymous
    January 01, 2003
    Hi,

    I'm glad you are addressing the printing right hand margin overflow issue, but there are some other nice to haves. Where is the correct place to request these?

    For example, if I host an Office document within a frame, I lose the ability to print this easily - if the Office document appears in a full browser window, then the Print command invokes the applications print dialog, but this does not appear to happen when the item is embedded in a sub frame. There are also some peculiarities when printing to certain office applications; PowerPoint [correctly?] pops up it's print dialog, but Excel/Word don't or don't do so reliably.

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    I gave up on IE years ago because 90% of pages I printed lost the right hand 10-30% of the text. Mozilla (and now Firefox) did print and print preview nicely. Adjusting the text zoom makes, plus multipage per page (in normal windows printer driver setting) makes for a very nice way of printing text for reading on the train. Tabs and standards compliance are great with Mozilla but it was the printing which converted me.

    Enjoy.

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    As promised, I
    want to talk today a little bit more about printing experience in IE7. Printing
    is...

  • Anonymous
    May 02, 2007
    PingBack from http://www.jeffhung.net/blog/articles/jeffhung/173/

  • Anonymous
    January 02, 2008
    PingBack from http://blog.rebeccamurphey.com/2008/01/02/fixing-width-issues-with-ie6-print-stylesheets/

  • Anonymous
    January 08, 2008
    The comment has been removed

  • Anonymous
    September 24, 2008
    PingBack from http://ndaprints.ndadesigns.com/blog/?p=21

  • Anonymous
    May 26, 2009
    PingBack from http://backyardshed.info/story.php?title=ieblog-ease-the-pain-with-ie6-printing

  • Anonymous
    May 29, 2009
    PingBack from http://paidsurveyshub.info/story.php?title=ieblog-ease-the-pain-with-ie6-printing

  • Anonymous
    June 08, 2009
    PingBack from http://jointpainreliefs.info/story.php?id=237

  • Anonymous
    June 08, 2009
    PingBack from http://hairgrowthproducts.info/story.php?id=3779

  • Anonymous
    June 12, 2009
    PingBack from http://toenailfungusite.info/story.php?id=6129