cmuebro has asked for the wisdom of the Perl Monks concerning the following question:

hey wise monks,

I have a web-site on which users can print vouchers and delivery-labels (with which they pay for parcel-services).

My PROBLEM is:
How can I prevent users from printing one formular (or voucher) more than one time?
The forms have certain series-numbers and if someone would print a form with one number several times, s/he would only have to pay once to the parcel-service, which our client doesn't like too much, i.e. wants us to prohibit.
If not- we're going to have to cancel contracts, for which I have invested lots of time and my boss his money....

So far I have been using the JavaScript-function print() for printing because it was the easiest way ;-)

In the window (which opens the browser) you use for printing it is possible to choose the number of copies you want to print = not good...
Is it possible to set the number of possible copies fix? or do you have/know a possibility to print out online-forms without having to open this certain window?
We're looking (desperately) for a way to at least prevent that users print out several same forms directly from the web-site.

We would be very grateful for ideas and heeelp.
thank you very much
cmuebro

Replies are listed 'Best First'.
Re: Print HTML-documents just once
by jhourcle (Prior) on Jun 04, 2005 at 16:58 UTC

    You can't ... at least not through basic web technologies -- HTTP, JavaScript, etc.

    This is in the realm of DRM (digital rights management ... the stuff that's driving the 'broadcast flag' and un-copyable music.)

    There is absolutely no way to completely restrict someone from printing more than one copy -- all you can do is make it more difficult and complicated. (hell, they can always xerox it afterwards, or otherwise counterfeit it).

    The solutions that I've seen for these sorts of things involve hardware solutions. (specialized printers, which are locked down, and need to receive some sort of changing handshake before they'll print) ... but which someone with enough time could probably fake out

    I'm guessing that if you've agreed to deliver something that you don't have experience in, such as this, that you may wish to look for companies that specialize in this sort of thing, and see what it would require to license their technology, and do a cost/benefit analysis of licensing, vs. doing a bad job on this, vs. defaulting on the contracts.

      I worried about it... that there is no solution.

      And -- it's not so dangerous for us. Because we won't deliver the parcels. We just want to integrate the service for our customers to print the parcel-labels for GLS (German Logistic Service). And we've got a requirement specification from GLS.

      Our problem -- we are the first ones who tried it -- and the yesterday put up new rules *mmmmmh*

      Now we have to start new negotiations.

      cmuebro
Re: Print HTML-documents just once
by CountZero (Bishop) on Jun 04, 2005 at 17:50 UTC
    The only way this can be done is having the user download a compiled program that securely connects to your server, gets the data to print the labels and doesn't allow printing of multiple copies. Because of this you can't do it through the normal Windows printing routines.

    Even then it would not be too difficult to install a default printer which "prints" the label to a PDF-file and thus allows this file to be printed many times.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re: Print HTML-documents just once
by salva (Canon) on Jun 04, 2005 at 17:28 UTC
    forget about not letting the user print the vouchers several times.

    The rigth solution is to make the parcel service track in some way which vouchers have already been used and reject them.

Re: Print HTML-documents just once
by Ninthwave (Chaplain) on Jun 04, 2005 at 17:01 UTC

    And even if you could nothing would stop someone from photocopying them.

    "No matter where you go, there you are." BB
      Yes sure - I can't stop someone to copy it.

      But it's a (very silly) restraint of the parcel-service.
      AND - I don't understand it too ;-)

      cmuebro
Re: Print HTML-documents just once
by TedPride (Priest) on Jun 04, 2005 at 20:20 UTC
    You can restrict them to LOADING the documents only once, by feeding all views through a script and keeping a database of which users have viewed which documents, but you can't restrict them to USING the documents only once. To do something like that, you need to track which numbers have been used already, which means adding tracking to the package delivery service end of things.
Re: Print HTML-documents just once
by Cap'n Steve (Friar) on Jun 05, 2005 at 06:08 UTC
    It's impossible and really, it's not your problem. The parcel service should be checking to make sure the numbers aren't being used more than once.
Re: Print HTML-documents just once
by zentara (Cardinal) on Jun 05, 2005 at 10:02 UTC
    Like others said , you can't. Quite often when I print from a browser, I "print-to-file" and can make as many copies as I want. The best solution, although not the only one, is to print a unique identifier , like a barcode, on each document, and store them in a database. You can then get "very creative" on how to use your database to check veracity of the documents.

    For instance with "entrance passes", you could have the purchaser upload a photo of who will be using the pass, then when the passes are barcode-scanned, the photo associated with that barcode must look like the person using the pass.

    You don't say how your "series numbers" are being used, but you could probably work out some scheme, even charge clients extra if their vochers are used more than once. Barcodes make this easy.


    I'm not really a human, but I play one on earth. flash japh
Re: Print HTML-documents just once
by Anonymous Monk on Dec 05, 2005 at 12:42 UTC
    Thank you all for your hints and tips.

    I solved the problem with creating PDF files. There you can define that the document just can be printed once.

    By the way - PDF gives the publisher the possibility to configure the document in many ways. You can set security options like access password for opening the document, grindability and print options (e.g. the document can just be printed once or x times, writable access, etc.)

    good luck
    cmuebro