Is it possible to print directly to printer?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Is it possible to print directly to printer?

Post by vinoth »

Hi all,

I am working ecommerce website with zencart.
In that project, I want to print the order at the final checkout page.

The order should print on the printer attached on the client's system.

Is it possible to print remote printer without customers notification ?

Please provide me some solutions, code or reference.

Thanks in advance

Vinoth
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: Is it possible to print directly to printer?

Post by Darhazer »

No, you cant't use client's hardware without clien't permission.
You can use window.print() JS function to popup the print dialog
Or you can write a browser plugin that performs the print (a collegue of mine wrote such ActiveX, but since it was an internal system it was not a problem to limit to IE only), but still the client should install it.

And why would you want to print on the client's printer, what if the client have no printer at all? Better just ask him to print the page - you'll give the client a chance to save the page and to go to another computer with printer attached to print it.
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Re: Is it possible to print directly to printer?

Post by vinoth »

Don't think about clients printer. we need to print on some printer its located on somewhere.

Its an ecommerce site for an hotel, customer will order from his home. once the order got confirmed we need to print the order on the deticated printer. The printed copy is consider as the bill or somewhere.

Hope you will get my requirements.

Is there any other alternative solution for that
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: Is it possible to print directly to printer?

Post by Darhazer »

The order should print on the printer attached on the client's system.
But if you want to print the order on a printer, attached to the server, that's possible
Take a look at CUPS
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Re: Is it possible to print directly to printer?

Post by vinoth »

Hi Darhazer,
Thanks for your reference,

I am not getting clearly.
"attached to the server" means where we need to connect the printer?

I will try the CUPS and get back soon.

Thanks again
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Re: Is it possible to print directly to printer?

Post by vinoth »

Hi all
I checked the CUPS documentation, I don't know where to install CUPS ...

Is any other option is there to print..

Thanks in advance.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Is it possible to print directly to printer?

Post by VladSun »

Where are the printer and the web server located - can you connect the printer directly to the server?
Is it Linux or Windows OS server?
There are 10 types of people in this world, those who understand binary and those who don't
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Re: Is it possible to print directly to printer?

Post by vinoth »

hi Viadsun

We are using Linux server,
Please provide any guidelines.
User avatar
Weiry
Forum Contributor
Posts: 323
Joined: Wed Sep 09, 2009 5:55 am
Location: Australia

Re: Is it possible to print directly to printer?

Post by Weiry »

vinoth wrote:hi Viadsun

We are using Linux server,
Please provide any guidelines.
I think you missed the first line of his post.
He cant give you much help unless you help him out first :)

What he means is, can you physically get a cable from the printer, and plug it directly into the computer you are using as a server.

Code: Select all

 _______         ______
|Printer|------>|Server|
 ¯¯¯¯¯¯¯         ¯¯¯¯¯¯
Or is it on a network?
 _______                 ______
|Printer|--->{Switch}-->|Server|
 ¯¯¯¯¯¯¯                 ¯¯¯¯¯¯
Post Reply