To print directly without showing the window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • getmeidea
    New Member
    • Feb 2007
    • 36

    #1

    To print directly without showing the window

    Hi,

    I have a code like this

    [CODE=javascript]function printDocument(u rl) {

    var newWindow = window.open(<ur l>, '_blank');
    newWindow.print ();
    setTimeout(<fun ction name>,2000); // code for delaying to complete printing
    newWindow.close ();
    }
    [/CODE]
    Here the specified window gets opened and printed. But I actually need to just print the window(newly opened url) without showing it to the user.

    I need the code for this.
    Last edited by acoder; Dec 6 '07, 08:44 AM. Reason: Added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Originally posted by getmeidea
    But I actually need to just print the window(newly opened url) without showing it to the user.
    The only thing I can think of is having the print page as part of the main page, but hidden. Use CSS print media settings to display when printing.

    Comment

    Working...