counting number of invoice printing

Hi all,

Is it possible to know how many time that one invoice is printed? I want to trace whether a invoice is printed or not? Can javascript interact with printer?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The only thing you can do with JS concerning printing is to launch (through window.print) a request for printing - that is open the print window where the user must confirm the print.
You can't even check if the user said OK in this window, neither auto launch the print task without prompting.

Hope this help ;)
Ian GoughCommented:
<form><input type="button" value=" Print this page "
onclick="window.print();return false;" /></form>
<a href="#" onclick="window.print();return false;">print</a>

And i'd prob use database counter system so everytime the button was pressed it added 1 to the database. (Using the <form> not the onclick)
Just an Idea,
Ian GoughCommented:
Ok i can't seem to fine any where that .js can write a log file so you prob have to use php counter system and you just need to change the button to an image and get a click counter then it will write a log file in php.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

sdiekenAuthor Commented:
I did as the first iangough7 comment but I meet a problem as smaccari comment. I can't even check if the user said OK in this window :( What I want is to count a real printed invoice.
As i told you, you simply cannot do this in JS ;)
Jens FiedererTest Developer/ValidatorCommented:
You should listen to smaccari.

When you are doing js, you are helping to provide some content.  You simply DO NOT GET TO CONTROL the user's machine.

If what you need to "control" your user, your option is to run some application object (Java or ActiveX, for example), make the invoice information ONLY available to that object...and display (since anything you display normally can be captured in a screenshot and printed outside of your control) and print ONLY from that object.  This is not really JS.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.