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

Ensure that print page has delivered to the printer with php

Dear experts,

Is there a way for me to notify user when the print page has successfully been printed from printer with php or javascript or other methods?

Currently I have code up to the page with window.print(). After user confirms to print, the printer can give feedback as to whether the page has been printed successfully?

Kinderly Wade
Kinderly Wade
3 Solutions
Dave BaldwinFixer of ProblemsCommented:
No.  PHP runs on the server and has no access to the client machine.  Javascript is not allowed to access the local machine either.  Even if you 'open' the printer properties on the client machine, it only tells you that the software completed the task and there is nothing left in the printer queue or that there is a software error.  Some printers will popup an error message if there is a hardware error like no paper or a paper jam.
I suppose you could request the printer's pagecount before and after the printjob. This can be done using either PostScript or PJL, as well as SNMP - which is probably the best choice. See, for example:


If using PJL or PS via a server, you run the risk that some other job gets in between yours and the count requests because, as far as the server is concerned, the pagecount request is a separate printjob. What do you do if you send 1 page and the printer reports 2?
Ray PaseurCommented:
I tend to agree with Dave - this is a mostly fruitless approach.  There are too many variables, and window.print() does not return anything.  You might get this kind of information inside a single-computer environment, but when you're working over the HTTP protocols in a client-server environment there is too much isolation of the different components.  If you can tell us a little more about why you want this (from a high-level, business-rules perspective) we might be able to suggest some ideas.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Kinderly WadeprogrammerAuthor Commented:
Hi all,

I am deciding to create  a monitoring screen for users that wish print. They are printing orders on daily base. There will be time when printer is unable to print their orders out or they've pressed the print button from the application but unable to ensure if the printer has printed the orders. (There is a large volume of orders need to be printed so it is impossible for them to check each time when they print orders).

I am trying to create a small app called monitoring system which checking to see if printer is function properly. This allows the user to see the warning if printer goes down, paper jam, or other reasons that may cause the orders unable to be printed.  

This is a client-server environment which there is a print server that has been setup for all printers. The PHP app is running on the application server. I was wondering if I am able to retrieve information of printer from my printer server from application server that allows me to check the printer status.

I did suggested the company if they wish to do paperless orders which orders can be displayed instead of being printed and these information will also be reserved in database. In case anyone needs a copy of order, it can still be retrieved. Company doesn't want to go paperless at this point or else I will not encounter this issue.

Any other good suggestion will be great. THanks.
Dave BaldwinFixer of ProblemsCommented:
The idea that these things should be 'do-able' comes from the fact that they are... just not over the web.  Networked desktop software used to be written so it had access to all of those things because it would run as a system or admin process.  You can't do that with web pages.  The desktop software was run in a closed system.  Web pages can come from anywhere in the world including from malicious sources.  That's why there are all these security barriers that prevent you from accessing client machines.
Ray PaseurCommented:
there is a print server that has been setup for all printers
This is an interesting "lead" in the hunt for a clue.  Can it run PHP?  Can it expose a GET-method API that divulges the status of the printer(s)?  If so, this might move from the realm of the "essentially impossible" into the realm of "difficult and time-consuming research project."  You would want to take on this task via a time-and-materials contract only!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now