Solved

Ensure that print page has delivered to the printer with php

Posted on 2014-09-04
6
337 Views
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?

Thanks
0
Comment
Question by:Kinderly Wade
[X]
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
6 Comments
 
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.
0
 
LVL 38

Assisted Solution

by:hdhondt
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:

http://www.bleepingcomputer.com/forums/t/487137/hp-printerssnmp-get-page-counts/

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?
0
 
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.
0
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 

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.
0
 
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.
0
 
LVL 110

Accepted Solution

by:
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!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

733 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