SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Printing page content

    Hi,

    I've got a bit of a problem that I'm not really sure how to approach.
    On the page that displays some critical data I would like to print out some things that the user could keep handy. There is no way so need for the user to actually see the final output before printing since the data is already displayed on the current page and the data printed is the same just rearranged and some additional disclaimer text.
    So how would I go around doing this that when I user clicks on a link/button/icon that the data I need gets printed?
    Do I make a popup that looks like the page that would be printed, but how do I the let the user print it. Do I make two frames and use a java stcipt and a button to print or just one frame and just print automatically?
    What about the layout how can I make the layout so that it fits onto a single page. Do I just design it as a website(I know I can use somethings in CSS) or something else?
    Or can I just make it without a preview window? Do I also make a preview window but just not show it and just show the print dialog or is there a nother way?

    Thanks for all the badly needed advice and help.

    A good day to all.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    If you use a separate meedia=print stylesheet you should be able to set up the way you want the page to print without needing to create a second page or use any additional features such as JavaScript.

    All web browsers have a built-in print preview option so there is no need to offer one from the page.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Wizard bronze trophy Tailslide's Avatar
    Join Date
    Feb 2006
    Location
    Bedford, UK
    Posts
    1,687
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah I agree with Stephen - build a print stylesheet where you dump all the unecessary stuff (banner images, navigation, floats etc) just leaving the useful information.

    I sometimes also add a print logo so that you get the logo at the top of the printed page if the web page logo isn't suitable for printing.
    Little Blue Plane Web Design
    Blood, Sweat & Rust - A Land Rover restoration project

  4. #4
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys, so when I have the data ready for printing I use media="print.css" but that's just part of my problem
    I don't want to print all the data.
    The site is set up something like this:
    - mon log
    - tue log
    - wen log
    - thu log
    - fri log
    - sat log
    - sun log
    And when the user would click on one of these links a print dialog would appear and the user would just select a printer an print. Now the problem is since the data of these logs is not displayed in full on the webpage how would I print the conten out without opening another page with the whole content?

    And how do I go about making the output so that each of the printed pages contain the same header and footer but different body.

    Thanks for the help, I'm really new to preparing data for other output than the screen.

    So thanks again.


Bookmarks

Posting Permissions

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