By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,645 Members | 1,048 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,645 IT Pros & Developers. It's quick & easy.

Disabling any and all user print functionality

P: n/a
I need to control the way a document is printed ...

I would like a user to print a 'ticket', however, if multiple 'tickets'
are selected, each ticket must be printed separately (separate piece of
paper per ticket) as each ticket holder MUST have their own individual
ticket for scanning (I can not assume the user would be smart enough to
cut up a piece of paper and distribute each ticket to each person :p)
.... I also need to make sure the ticket is printed at a res high enough
for a 2D bar code to be scannable ...

I know I can control printer hardware settings via PDF, but I need to
make sure the user doesn't just hit print, right click and print,
CTRL-P, or File | print ...

Is this possible? And if so, could you kindly point me in the right
direction?

Cheers,
Eclectic.

May 15 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ec*********@gmail.com said the following on 5/14/2006 8:20 PM:
I need to control the way a document is printed ...
JS and HTML aren't the way though.
I would like a user to print a 'ticket', however, if multiple 'tickets'
are selected, each ticket must be printed separately (separate piece of
paper per ticket) as each ticket holder MUST have their own individual
ticket for scanning (I can not assume the user would be smart enough to
cut up a piece of paper and distribute each ticket to each person :p)
.... I also need to make sure the ticket is printed at a res high enough
for a 2D bar code to be scannable ...
You can't predict that, unless you are looking at the printer (or know
what kind of printer every user has).
I know I can control printer hardware settings via PDF, but I need to
make sure the user doesn't just hit print, right click and print,
CTRL-P, or File | print ...


Put your ticket in a hidden IFrame. When the button is clicked, it
prints that ticket and then clears the IFrame out so that it can't be
reprinted. It is not 100% fool proof, but then again, nothing about HTML
or JS is.

You could see if Zeepe has the ability to do that, never tried it though.
<URL: http://www.zeepe.com/zeepeinfo/default.asp>
which leads to ScriptX:
<URL: http://www.meadroid.com/scriptx/>

It is IE only though.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 15 '06 #2

P: n/a
ec*********@gmail.com wrote:
I need to control the way a document is printed ...
You can't, with HTML. But you can strongly encourage...
I know I can control printer hardware settings via PDF, but I need to
make sure the user doesn't just hit print, right click and print,
CTRL-P, or File | print ...


You can't control hardware settings in any reliable fashion (ActiveX
controls may work in some cases for IE only).

You can supply an alternative print url which will be retrieved and printed
if the user tries to print in any typical fashion:
<link href="/print_content.html" rel="alternate" media="print">

Also, using CSS you can define rules which only apply when printing, for
example.

Neither of these have to do with JS, though, so another group would be more
appropriate.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
May 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.