Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Printer Friendly pages (print preview)

  1. #1
    Join Date
    Jul 2006
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Printer Friendly pages (print preview)

    I got my print.css style sheet set for a printer friendly pages.

    I when I click on the Printer Friendly Button on the page, it opens up the printer screen.

    Is there a way so that when you click on the print button, it opens the print preview function, then the user can see if the page fits his margins and if so, click the print button on that window?


    www.myraptor.net click on one of the drop down menus to see the page.


    Thanks,

    Girard

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Girard Ibanez
    I when I click on the Printer Friendly Button on the page, it opens up the printer screen.
    If scripting is enabled. In my opinion, it's better to just let the user use the menu or toolbar item in their browser.

    Is there a way so that when you click on the print button, it opens the print preview function, then the user can see if the page fits his margins and if so, click the print button on that window?
    No, not to my knowledge.

    Mike

  3. #3
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    For a page without graphics and stuff:
    Code:
    document.write(document.body.innerText)
    - Mike

  4. #4
    Join Date
    Jul 2006
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This is the code I am using for the printer friendly button. It pops up the printer properties (control P).

    Code:
    <input name="Printer Friendly" type="button" value="Printer Friendly" class="cursor" onclick="window.print()" />

    I tried:
    document.write(document.body.innerText)
    But it keeps searching.

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    document.write(document.body.innerText)
    is for making a printer-friendly page without graphics and links and other unwanted stuff.
    - Mike

  6. #6
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by mburt
    Code:
    document.write(document.body.innerText)
    is for making a printer-friendly page without graphics and links and other unwanted stuff.
    No, it most certainly is not. Girard is already doing it properly by using a print style sheet.

    The innerText property is proprietary feature that isn't implemented in most browsers. Moreover, preparing a printable document should never depend upon scripting.

    Mike

  7. #7
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Okay, I see you're point. I think you can print directly with PHP though, can you?
    - Mike

  8. #8
    Join Date
    Jul 2006
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    So I guess there is no way to call out the "Print Preview" function.

    Thanks again guys for the assistance.

  9. #9
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by mburt
    I think you can print directly with PHP though, can you?
    No, PHP is serverside. I know of no way to print a page from PHP(unless you are talking about a printer attached to the server)

  10. #10
    Join Date
    Jul 2006
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The print style sheet is working and the pages are formatted so that the user can print the web document without the navigational bar, etc. and the browser will not clip the image files.

    I have a print radio button that will pull up the printer page properties but what I want is for the radio button to pull up the print preview for that browser so that he can adjust his margins and then print the page.

    All this can be done at the browser menu but I created a radio button with the words "printer friendly" and wanted to make the button functional.

    http://team-raptor.net/myraptor/r50v...l_arm_tip.html



    Girard

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
  •