#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Posts
    25
    Rep Power
    0

    printing a piece of a page with javascript--is it possible?


    Well is it possible to have a button that prints part of a page? how about in landscape mode?
  2. #2
  3. No Profile Picture
    Seņor Member
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2000
    Posts
    1,157
    Rep Power
    37
    I believe you can tell the browser to print (acting as if you clicked the print button) with window.print(). However, you can't specify what to print or in what mode -- it will just bring up your print dialog box. Now, if you want to be sneaky about it, you could build the page in frames, have a teensy frame without scrollbars that isn't apparent to the user, dynamically build the section you want to print in that frame, and print just that frame. However, this method probably isn't foolproof, as I believe IE gives you the option of printing the entire frameset.
    Michael
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    2
    Rep Power
    0
    MSDN seems to imply you can use print templates to print part of a document. Select the portion you want to print and set the selection property to true.
  6. #4
  7. No Profile Picture
    Seņor Member
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2000
    Posts
    1,157
    Rep Power
    37
    Does MSDN happen to mention whether or not this is an MSIE-specific thing or is it an open standard?
    Michael
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    2
    Rep Power
    0
    I would think it is something specific to IE. I don't recall reading whether this was specific to IE or not. They do however state:

    Print templates first appeared in Internet Explorer 5.5, and were later improved in Internet Explorer 6.
  10. #6
  11. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Posts
    25
    Rep Power
    0
    thanks.

    the frame idea is good, i wil try it.

    what is MSDN?
  12. #7
  13. T-Shirt Tragic
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2001
    Location
    Melbourne, Australia
    Posts
    886
    Rep Power
    321
    MSDN is "microsoft developer network"
    http://msdn.microsoft.com/


    You might also be interested in having a look at the printing capabilities of CSS-
    http://www.blooberry.com/indexdot/cs...ndex/print.htm

IMN logo majestic logo threadwatch logo seochat tools logo