sending a page to the printer withoug pressing the printer b

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
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

sending a page to the printer withoug pressing the printer b

Post by pelegk2 »

i want to print pages to the printer
withought the need to press on the printer
i wantto give the user list of printer in the network
he chooses the printer and i send it to the selected printer with the selected file (an html file for example)
is it possible?
thnaks in advance
peleg
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

If you feel like experiencing the ongoing developing cvs tree of php you'd find the printer functions.

There are some usercomments on those pages that might be of interest.
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

viewtopic.php?t=26773&highlight=RTFM
Did you read the others posts?
Last edited by JAM on Mon Jan 17, 2005 5:41 am, edited 1 time in total.
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

JAM i didnt doble post!!!!

Post by pelegk2 »

and what iasked for is no thee printer functions but is there a way to print a file and that it will feet the an A4 page!
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Re: JAM i didnt doble post!!!!

Post by JAM »

pelegk2 wrote:and what iasked for is no thee printer functions but is there a way to print a file and that it will feet the an A4 page!
Sorry, my bad. What I really meant was; did you noticed their (in the other thread) links to the php manual? You should give it a try to look at it as most things might be obvious...
pelegk2 wrote:...i wantto give the user list of printer in the network...
http://www.php.net/manual/en/function.printer-list.php

Gather printer names with the function, and display them on the page of choise, preferably using <select>...

I'm however not sure that you would be able to send a pdf or doc to the printer as is, without converting it to PCL standards, text, RAW or whatever. And that is not fun i gather.
If it's like your example, an html file) you "should" be able to read the file into a buffer at text, use strip_tags on it (among other things) and then throw the buffer out to the printer.
Post Reply