Automatic Print

Posted on 2005-04-27
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
    LVL 5

    Expert Comment

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

    Accepted Solution

    You cannot do it with javascript.  It requires activex such as:

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

    LVL 5

    Expert Comment

    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.

    LVL 4

    Expert Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    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…
    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    761 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now