javascript: window.print()

Posted on 2003-03-24
Medium Priority
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.).  
Question by:usmanshahid
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
LVL 16

Accepted Solution

jaysolomon earned 90 total points
ID: 8194937

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.


LVL 14

Expert Comment

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

Expert Comment

ID: 8195052

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.


>>> 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.


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