Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS and printing pages

    I know there's tons of specific information on this topic but I was wondering if there's any general issues people have run across involving the use of CSS to set up a printer-friendly page. Things I'd *like* are:

    1) the ability to turn off the browser setting that gives the URL path on the footer
    2) general hints on text formatting/margin formatting that might be useful to know about (for example, what's a good general-purpose font and font size for printing, etc.)
    3) using page breaks intelligently (or if this is something to care about)

    NB: I am developing a CSS implementation that will require IE 5.5+ and the whole thing is on an intranet so X-browser bugginess is not a big concern.

    TIA
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20>

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: CSS and printing pages

    1) Why should a browser allow a web page to do this? Skeptical there is a way.

    2) Fonts with serifs are recommended for print output. Word's default choice of Times New Roman 10pt seem a bit small to me. I'd make "average" text Times New Roman 12pt. (The use of point measurements for the print style sheet is intentional.)

    3) Page breaks are tough. Good luck with those.

    I think not all browsers have complete support for media-specific style sheets, but at least IE 6 should be fine.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CSS and printing pages

    thanks for the reply. sounds like there's no real 'gotchas' in implementing page print via CSS. as for why I'd like to not have the URL print in the footer, it's not useful information (and looks weird) as most of the pages are dynamically generated. I know you can edit IE's print preferences to take it out but that has to be done manually. I can live with the limitation, tho.

    as far as page breaks, browsers seem to do 'OK' with that natively, altho some will re-print the last sentance on the next page and (occasionally) you'll see a line just cut in half. I am trying to put something functional together and I guess just relying on the standard (IE printout for a webpage will do OK).

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CSS and printing pages

    Despite not having a lot of specific advice to offer on your question, I do have a few thoughts from my experience in this area.

    Newer browsers are generally friendly for printing (as you've discovered), but that only applies to default formatting. If a user has modified font sizes, margins, or other settings your carefully formatted page could look dramatically different than you intended. If you want true control over printing you'll have to use a reporting tool that is designed for that purpose. We use Active Reports by DataDynamics. It's not cheap, but it does some AMAZING things! There are separate versions for Classic ASP and ASP.NET. It can display reports using its own custom ActiveX viewer, specially formatted HTML, PDF, Excel, etc... Plus, it can be used in Windows or Web applications! My company has been very impressed with this utilitiy and will continue to use it for the forseeable future.

    Second, you may be aware of some CSS2 properties that are meant to make printing easier. For the complete low-down on this, you'll want to get it directly from the horse's mouth. But for a quick overview, you can check W3Schools.com. The last time I checked, these properties aren't slated to be supported in IE until version 7 (maybe Longhorn timeframe?).

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CSS and printing pages

    thanks for the thoughts. this little project of mine (little??!! I'll be working on this for a year it seems <img src=/S/heavy.gif border=0 alt=heavy width=40 height=34> ) has gone thru many permutations -- in my mind at least -- with regards to getting a nicely formatted output. the first thing I did, in a frenzy of not-very-well-researched thinking, was lobby for (and get) ActivePDF, an $800 com object that is supposed to output nice clean PDF docs from db info. Maybe it does, but right now it doesn't.... well it can, but it's a lot of trouble. I could use it if people didn't want to be able to do things like apply formatting and tabs, bullets etc. to text in a webform. Which led me to use htmlarea (an asp module) that does a wonderful job (for the most part) providing text formatting. In some ways, I am happy that htmlarea screws up the PDF output because I'm not going to get proficient enough in it in time to do anything nifty. (also we bought a single-site license and the PDF will eventually have to be emitted by the live webserver, not my dev machine and that means more $$ for the licensing... yadda yadda yadda.)

    SO, back to setting up a nice output on a webpage. I think, since I am assured of an audiance using IE 5.5+ or better (required to get htmlarea to function) I can fix up some nice looking formatted printable pages and, sometime later, mess with the PDF output. htmlarea seems keen on restricting the width of any content to the width of it's textarea so I haven't noticed margin problems. Fingers crossed there won't be any.

    BTW, I am working for the State of Texas which (since Mssr Bush left) is billions of $$ in debt so everyone wants free solutions. They even said they'd gladly offer me a Systems Analyst position without the pay rate -- very <img src=/w3timages/censored.gif alt=censored border=0>ing generous. Well, hopefully that'll sort itself out but if not this little project of mine might be put up for adoption...

    The other thing to worry about is allowing people to SAVE their nicely webpage reports. I'd prefer not to let that happen but I can just see the request coming down the pike....

    Ah well, another day of coding...

    <img src=/S/compute.gif border=0 alt=compute width=40 height=20>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •