Ensure that print page has delivered to the printer with php

Posted on 2014-09-04
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 83

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 38

Assisted Solution

hdhondt earned 100 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 110

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.
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now


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 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 200 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 110

Accepted Solution

Ray Paseur earned 200 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

Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

696 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