?
Solved

javascript: window.print()

Posted on 2003-03-24
3
Medium Priority
?
1,032 Views
Last Modified: 2013-11-19
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
Comment
Question by:usmanshahid
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
jaysolomon earned 90 total points
ID: 8194937
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
 
LVL 14

Expert Comment

by:avner
ID: 8195010
You can do this using PDF or ActiveX. not using HTML or JavaScript in any way.
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 8195052
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question