[Last Call] Learn how to a build a cloud-first strategyRegister Now


Automatic Print

Posted on 2005-04-27
Medium Priority
Last Modified: 2008-03-10
I need make a function in JavaScript that automatic print in a specific printer and in a specific tray...

Do you know an object that permit do this?

Question by:cschmid
  • 2

Expert Comment

ID: 13880221
window.print() is all you have to do to start the print.
LVL 53

Accepted Solution

COBOLdinosaur earned 1500 total points
ID: 13880243
You cannot do it with javascript.  It requires activex such as: http://www.meadroid.com/scriptx/index.asp

Okay on an intranet but not rocommended for use on a public website.  IE only.


Expert Comment

ID: 13880269
But let me note that it will only work in IE5+ and it will still prompt for confirmation.   You should be very happy that clients do not support automatic printing, as it would be a disaster if people could force pages to print when you visited their page.

You can use an activex control if you need to force a print, or if its in an intranet situation you could use server-side code (asp....) to have the server initiate a print to a specific printer.


Expert Comment

ID: 13887219
If it's for use on an Intranet (and that's the only scenario I can imagine it being useful), I'd build a server-side DLL using VB, which will print to a given printer and tray, then call it with form data and ASP. This could be triggered with Javascript if you really wanted...

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

834 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