473,321 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Printer functions

I've got a problem using printer functions with my network printer shared on
another PC as \\192.168.1.3\HP

If the printer is connected and reachable, printer_***() functions work
correctly.

Now let suppose the printer cable is unplagged so the printer is no more
reachable:

$handle = printer_open($printer_address); // Returns an handle also if the
printer is unreachable (it is strange, it should return null)
printer_start_doc($handle, "My Document"); // Returns false. It is correct
because the printer is unreachable.

Now I reconnect the printer cable:

$handle = printer_open($printer_address); // Returns the handle
printer_start_doc($handle, "My Document"); // RETURNS FALSE ALTHOUGHT THE
PRINTER IS CONNECTED.

At this point I cannot print anything using printer functions.
I have to stop and restart Apache service to get TRUE from
printer_start_doc() and every thing works correctly again.

Any idea ?

Thanks for the help.

Stefano
Aug 16 '08 #1
4 1997
Stefano wrote:
I've got a problem using printer functions with my network printer shared on
another PC as \\192.168.1.3\HP

If the printer is connected and reachable, printer_***() functions work
correctly.

Now let suppose the printer cable is unplagged so the printer is no more
reachable:

$handle = printer_open($printer_address); // Returns an handle also if the
printer is unreachable (it is strange, it should return null)
printer_start_doc($handle, "My Document"); // Returns false. It is correct
because the printer is unreachable.

Now I reconnect the printer cable:

$handle = printer_open($printer_address); // Returns the handle
printer_start_doc($handle, "My Document"); // RETURNS FALSE ALTHOUGHT THE
PRINTER IS CONNECTED.

At this point I cannot print anything using printer functions.
I have to stop and restart Apache service to get TRUE from
printer_start_doc() and every thing works correctly again.

Any idea ?

Thanks for the help.

Stefano

What platform are you on here? windows or Linux, or something else?

Aug 16 '08 #2
>>
What platform are you on here? windows or Linux, or something else?
I was trying printer functions under windows ... since they work only under
windows. I have also a Linux server available but that set of functions is
not available, is there anything similar ?
Aug 16 '08 #3
On Sat, 16 Aug 2008 23:00:16 +0200, in comp.lang.php "Stefano"
<aa*@aaa.it>
<48***********************@reader4.news.tin.itwrot e:
>| I've got a problem using printer functions with my network printer shared on
| another PC as \\192.168.1.3\HP
|
| If the printer is connected and reachable, printer_***() functions work
| correctly.
|
| Now let suppose the printer cable is unplagged so the printer is no more
| reachable:
|
| $handle = printer_open($printer_address); // Returns an handle also if the
| printer is unreachable (it is strange, it should return null)
| printer_start_doc($handle, "My Document"); // Returns false. It is correct
| because the printer is unreachable.
|
| Now I reconnect the printer cable:
|
| $handle = printer_open($printer_address); // Returns the handle
| printer_start_doc($handle, "My Document"); // RETURNS FALSE ALTHOUGHT THE
| PRINTER IS CONNECTED.
|
| At this point I cannot print anything using printer functions.
| I have to stop and restart Apache service to get TRUE from
| printer_start_doc() and every thing works correctly again.
|
| Any idea ?
|
| Thanks for the help.
You say that you disconnect and reconnect the cable. Have you tried
turning the printer off then on again?
This could be the reason that the printer is still not responding.
Have you tried printing a document, via word etc, to the same printer
once you reconnect the cable? If this is not successful then it would
indicate that the printer hasn't re-initialised the network
connection.
Aug 16 '08 #4
Stefano wrote:
>What platform are you on here? windows or Linux, or something else?

I was trying printer functions under windows ... since they work only under
windows. I have also a Linux server available but that set of functions is
not available, is there anything similar ?

SAure. Under linux you talk to a printer susbsytem, which talks to
either local or remote printer.

Google CUPS for how to set the whole thing up.
Not sure how its invoked from php though..probably by exec-ing lp..
Aug 17 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Fotis Andritsopoulos | last post by:
Hello, I tried to find out how can I print a document through php. What I want, is to add a "print button" within a web page (something like the "Print" button of the explorer, but within the...
3
by: Mario | last post by:
Hello, I am a new Python entusiast, I am studing it since some weeks and I think it's a great language and I was very happy with it, but when I came to make a printer routine I really got...
5
by: Hank | last post by:
My Access 2000 code has been running for several years in our main plant. Now we need to install it, as a stand-along application, at remote sites, some of which are out of state. My problem is...
0
by: Jim Warner | last post by:
I am having problems using Borland 5.02 C/C++ for testing printer status repeatly. I wish to use my printer to detect off-line, removing paper, and so on with my software. I have tried using...
1
by: chunming | last post by:
hi, buddy, I use winspool.drv to write printer directly, I am developing the point of sales system, and I need set up the printer device font(not true type font), so that i could control the cash...
11
by: pamelafluente | last post by:
I am doing my own PrintDialog, and have placed there a combo with the printer names, as in the PrintDialog provided by VB.NET. Here is the question: how do I open the native windows printer...
4
by: Paul H | last post by:
OK, I tried getting and old Newbury Data ND2500 working using the "Generic /Text only" driver in Win XP. It prints, but I could not find a way to set a custom page size that matches the paper I am...
7
by: pI | last post by:
I've got simple question. What are some functions names in C for programming printers? Maybe some library ?
1
by: Chuck Anderson | last post by:
I have created an image using GD lib and now I would like to print it using the Printer functions (on Windows XP). Does anyone know how to write the image in memory to the printer (I assume I can...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.