• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 340
  • Last Modified:

select printer and print without prompt

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 here because i know that java can interact more with windows than a ie browser..
This is for an intranet made in php(html and javascript of course) and works with MsSql. Its not for outside www. 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 java is possible.
The language i use to code is php, but i don't think that the php printer functions can resolve this...
0
justaphase
Asked:
justaphase
  • 5
  • 4
  • 2
2 Solutions
 
objectsCommented:
what make u think its possible with java.
you can certainly print directly to the printer, but aren't you talking about a page displayed in IE?  Java can't easily get at that.
activex would seem a better tool for that job.
0
 
justaphaseAuthor Commented:
objects,
i'm thinking about an java aplet inside a web page, or a webpage calling java to print an html page, something like that. I allready saw some articles talking about this issue and showing some near examples, but i'm very very green at this language. I could use some good help from u guys, with an example, if its possible.

i allready searched for ActiveX to do this kind of job but it seems impossible. The nearest i found was using the TEMPLATEPRINTER that microsoft made it available to users(using javascript and vbscript i think), that could select the printer and print directly without prompt, but a year after they saw it as lak of security and explained it here: http://support.microsoft.com/default.aspx?scid=kb;en-us;308649

What should i do? If its possible with an ActiveX language it sure be better i know, but i dont think its possible.. if it add to break some security in the browser, that wouldn't be a problem because this is an intranet, it doesn't go outside for Wide World Web.

thx for the attention
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>>  and i need to select to wich printer i send the web page from the "html" code(or something else)

It looks like you will need an Applet to do that at the client, and for communicating with the printer it might need to be signed.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
justaphaseAuthor Commented:
>> It looks like you will need an Applet to do that at the client, and for communicating with the printer it might need to be signed.

any sugestions how mayankeagle? :)
0
 
Mayank SAssociate Director - Product EngineeringCommented:
I hope you know how to write a basic applet. So you need to write one and include an <applet> tag in your HTML so that it gets downloaded to the client-side. The applet can print using the normal print API:

For printing, you can use this:

http://www.java2s.com/Code/Java/Swing-JFC/AppletPrint.htm
0
 
justaphaseAuthor Commented:
i'm really dumb using pure java...
here's the example i'm doing: http://193.126.106.9/print/testeprintjava3.htm

but... doesn't work... how do i use that? i thought i was going to find some kind of function so i could declare the file to print or something... help me plz..
0
 
Mayank SAssociate Director - Product EngineeringCommented:
I get an exception: NullPointerException and so the applet does not get initialized.
0
 
objectsCommented:
applet would certainly need to be signed, but the problem is accessing the browser, not the printer.
0
 
justaphaseAuthor Commented:
needs to signed? how can i do that?
0
 
justaphaseAuthor Commented:
sentence correction: *needs to be signed? how can i do that?
0
 
Mayank SAssociate Director - Product EngineeringCommented:
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 5
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now