• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1034
  • Last Modified:

javascript: window.print()

hi there..
Well the javascript window.print() prints the entire page. What if i want to set the height/ width/ borders of the page to be printed. Is there any function available for this in java scripts. Or in VB scripts. and also the above function opens a printer dialogue.. Is there any way to send a print with out displaying a dialouge to user.?? (if not in js then in VB scripts.).  
regards
usman
0
usmanshahid
Asked:
usmanshahid
  • 2
1 Solution
 
jaysolomonCommented:
usmanshahid,

Use CSS style sheets.

Here is a link that explains how to create a style sheet for printing and also have another style sheet for rendering on the web.

http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_20543061.html

jAy
0
 
avnerCommented:
You can do this using PDF or ActiveX. not using HTML or JavaScript in any way.
0
 
jaysolomonCommented:
avner

i misread the Q..

>>>>>>>>>>> Is there any way to send a print with out displaying a dialouge to user.??

This would be a security breech.

As you said avner, you can use PDF or ActiveX.


usmanshahid,

>>> What if i want to set the height/ width/ borders of the page to be printed.

You can use css for this, you can set the style sheet to print what you want and not print what you do not want.

0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now