Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Ensure that print page has delivered to the printer with php

Posted on 2014-09-04
Medium Priority
Last Modified: 2014-09-04
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?

Question by:Kinderly Wade
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40302957
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.
LVL 39

Assisted Solution

hdhondt earned 400 total points
ID: 40303108
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?
LVL 111

Expert Comment

by:Ray Paseur
ID: 40303181
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.
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.


Author Comment

by:Kinderly Wade
ID: 40304050
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.
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 800 total points
ID: 40304169
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.
LVL 111

Accepted Solution

Ray Paseur earned 800 total points
ID: 40304530
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!

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question