Click to See Complete Forum and Search --> : Tell printing status
saidbakr
07-23-2008, 12:24 AM
Hello,
Is there any way, let we say by means of Java Applets, Flash or even ActiveX, that allow server receive the status of the client's printer about printing the current page.
I have an application in-which I need the script able to determine that user printed the out put page or not. In other word something like onPrint(submit(var,toTheServer)!
Is Flash's Action Script able to get such result?!
bretticus
07-23-2008, 05:04 AM
I really doubt there is a way to do this. Security mechanisms would probably prevent it. I have resulted in the past to prompting users to indicate if they printed correctly.
If this will be intranet accessible only. You might be able to use an HTA file and vbscript to get print status (http://www.microsoft.com/technet/scriptcenter/guide/sas_prn_lkqw.mspx?mfr=true).
saidbakr
07-23-2008, 05:30 PM
Hi,
Today's early morning an idea is jumped in my head. This idea depends on your suggestion about asking the user about printing. However, it has some verifications about his answer.
The verification is supposed to be something like CAPTCHA. It will be some string that does not displayed on screen but just displayed on the printer ( on the printed paper ).
This will depend on DHTML. In other word, in printing page the user will click a button that call function which should do two things:
1- Create a text on the page and using css this is only displayed over printer media.
2- call printer function.
Calling Printer Function leads to blure the window, so using window focus we will call another function that will display none this text, so if the user used print preview he will not be able to read the text.
After that he will be asked to read the text over the printed paper and then insert it in the verification code box to set this page as printed.
bretticus
07-23-2008, 06:06 PM
That's really a great idea!
I was thinking that for your css print media version you could use background-image: to load a php-rendered image with a random string that you store in the session. It's be easy to validate that and hard (obfuscation) for the user to figure out how to bypass it.
Another way I have used in the past is to use a hidden iframe and change the src:
.hiddeniframe {
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
<iframe class="hiddeniframe" name="printiframe" id="printiframe" width="1" height="1"></iframe>
function frameprint()
{
document.getElementById('printiframe').src='/print.php';
document.getElementById('printiframe').focus();
document.getElementById('printiframe').print();
}
to a page that returns the contents to be printed. This makes it very difficult for the user to meddle with (especially if you send a token rendered via dhtml that generates the random string image.)
None us this is impervious to a determined hacker (at least manually), but it should work.
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.