SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: window.print()

  1. #1
    SitePoint Member
    Join Date
    Jun 2004
    Location
    New Orleans, USA
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    window.print()

    I have the function printPage() in a purchase order print page and it works fine. However, is there a way to bypass the printer dialog box and go straight to the printer? This is an inhouse app with all printers captured and no browser issues so the user getting the printer dialog is not necessary.

  2. #2
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This use to work for the Older IE browser and NS4 version browsers, but not sure now.
    <script>
    function Print() {
    if (document.layers) {
    window.print();
    }
    else
    if (document.all) {
    WebBrowser1.ExecWB(6, 6)
    //use 6, 1 to prompt the print dialog or 6, 6 to omit it;
    WebBrowser1.outerHTML = "";
    }
    }
    </script>
    <object ID="WebBrowser1" WIDTH="0" HEIGHT="0"
    CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
    </object>

    <body onLoad="Print()">

    I believe the object part should be in the body section.


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
  •