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
LVL 82

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

by:Herman D'Hondt
Herman D'Hondt 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 108

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.
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails


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 82

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 108

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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)

759 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now