SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    england
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Javascript and print commands

    Hiya

    I've never used JS to print anything before so I have a few questions I've been unable to find the answer to elsewhere!!!

    If anyone could help me that'd be great!

    My questions are:
    1. Can you send a page to the printer without the user having the click on the print dialog box (I understand window.print() will bring up the dialog box).
    2. Can you change the print orientation (i.e. landscape or portrait) via javascript?
    3. I know you can print say, just the contents on the iframe, by doing something like window.iframename.print(), but is it possible to print a document on the server, without it having to be open in a window?
    I think the answer is no, but I don't know!

    And on a side, is it possible to rotate an image via javascript?

    Thanks!!!

  2. #2
    SitePoint Wizard silver trophy rushiku's Avatar
    Join Date
    Dec 2003
    Location
    A van down by the river
    Posts
    2,056
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    1. No, think of the 'fun' that could derived from printing 15,000 pages of garbage if this were allowed.

    2. I don't believe so, it appears that once the dialog has been called, it's out of your hands.

    3. No, javascript operates on the client side, which means that the file would have to be in the client's browser to be window.print()ed.

  3. #3
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    england
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cheers for your reply!

    I had my doubts that those things could be done, but having never used javascript to print before, just wanted to check!

    cheers 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
  •