Results 1 to 2 of 2

Thread: Printing from browsers

  1. #1
    Join Date
    Jan 2010
    Posts
    34

    Printing from browsers

    Hi,

    There are certain pages on my site that contain graphs and other tabular data that I would like to provide a "Print" button for; that, when clicked, launched the user's default print dialog and allows the user to print that page...

    However, I want to be able to only specify the graph or tables as part of the print. In fact, through this Print button, I don't want the user to be able (!) to print any other components of the page, including the traditional print headers and footers that most browsers insert automatically, such as showing the URL of the page being printed, page numbers, etc.

    Is this even possible? How can I basically declare certain sections/divs/etc. of my page printable and only allow those items to be printed through this custom Print button? No headers or footers. No requirement that the user first highlight the graph or table and then print "selected highlighted" in the print dialog...

    ?

    Thanks for any feedback!

    bubonic

  2. #2
    Join Date
    Mar 2010
    Location
    England
    Posts
    1,144
    Im not sure if you can do that, you would have to try it out. You could try the following.

    HTML Code:
    <a href="javascript:void();" onclick="document.element_name.print();">Print</a>
    i dunno if that will print just that element, or the whole page?, you could do this:

    HTML Code:
    <link href="print.css" rel="stylesheet" media="print" />
    Then in the print stylesheet you can tell your site to only show the content (so you can go: #sidebar { display:none;}

    Thats the only thing i cant think of.

Similar Threads

  1. Cheap Sticker: Capturing Your Imagination!
    By bryanfuller in forum Website Design Reviews
    Replies: 0
    Last Post: 02 Jun 2009, 02:12 PM

Posting Permissions

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