Direct to chosen printer

Posted on 2006-03-29
Last Modified: 2010-08-05
Hello everybody,

I have a big dificulty with printing issue. I allready search the net but the answers i saw can't seem to get it right.. i'm posting in general webdev because i dont know wich language code will resolve my problem..
This is for an intranet made in php(html and javascript of course) and works with MsSql. Its not for outside www. I'm telling this because what i want will brake the web security for sure, because certenatly i have to use ActiveX and maibe vbscript.. maibe.. i don't know...
I need to print directly to the printer an html page without the prompt window, and i need to select to wich printer i send the web page from the "html" code(or something else).
I know that its impossible with javascript, but i know that with vbscript we can interact more with the browser settings and other stuff.
Is it possible? It can be vbscript, java, php, whatever, i just need to make it work.
The language i use to code is php, but i don't think that the php printer functions can resolve this...

thx in advanced
Question by:justaphase
    LVL 10

    Expert Comment


    You will not be able to decide on behalf of the local user which printer you want them to use. the best you can use is the window.print() javascript function.


    LVL 1

    Author Comment

    I know there's a way Aplimedia... not with normal coding like html or javascript.
    An example i have is that u can´t remove the headers and footers from a print page automaticaly with html coding or javascript, but u can with vbscript... i just don´t know how to chose a printer and print directly with vbscript or pure java or some other language that works as an ActiveX object..
    LVL 7

    Accepted Solution

    LVL 1

    Author Comment

    i've been studing the templateprinter from microsoft from the link you gave but, as allways microsoft add to do some of their own mustakes...;en-us;308649

    i'm really getting stuck... and i really have to do this :(
    LVL 4

    Expert Comment

    justaphase: There is no way to do this.  It would be a huge security hazard if you could use scripts to print automatically (think of a site that tried to print out 10000 pages of gibberish or porn).  The best you can do is have it automatically take them to the printer-selection/print setup dialog.
    LVL 1

    Author Comment

    i know that it is a big security hazard noamattd, i post this question here just to know if there is an alternative with some web language that would ask me to install a certification or an applet, or an ActiveX and the client would be responsible for that script action... should never be something to break trought security, its not my goal... i'm not an hacker if that's what u thinkin :D
    LVL 1

    Author Comment

    Guess this question shouldn't be here. I allready put this question in the apropriate topic, this should closed or deleted, i forgot how to do this...
    LVL 75

    Assisted Solution

    by:Michel Plungjan
    1. ScriptX from
    2. WSH - no problem on intranet/web applications

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
    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…

    745 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

    14 Experts available now in Live!

    Get 1:1 Help Now