Solved

can I forbit printing of my .html?

Posted on 1999-01-18
7
183 Views
Last Modified: 2010-04-09
i try hamp with writing instead of spaces some letters with background color. Thats work with IExplorer3, but not with Netscape, he print as see.
I found some media type PRINT, so:
 <STYLE type="text/css" media="print">
   H1 { font-size=0,font-color="some bgcolor" }
 </STYLE>
must prevent printing, but I filed to to.
0
Comment
Question by:Beast101598
7 Comments
 
LVL 4

Expert Comment

by:seguret
ID: 1845408
If you really want to forbid printing, it's impossible. Anybody can write a browser (I did it...) and print what's received.
0
 

Accepted Solution

by:
Glyn011499 earned 50 total points
ID: 1845409
Forbiding printing is impossible as of today. Although some tricks.....place a lot of spaces in your html code so the you have to scroll way down to view your source. Then go back to the top and type "Forbidden Access" in the upper left corner of the document. This will fool a lot of people who don't notice the scroll bar ......
0
 

Expert Comment

by:Mimic34
ID: 1845410
there are some random escape lines that printers may think that is what they are and stop printing.  i've had one problem with this, but anyone can load the page and then 'print screen' and do it that way.  there is really not much of a way to stop somebody from printing.  sorry.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Expert Comment

by:Mimic34
ID: 1845411
there are some random escape lines that printers may think that is what they are and stop printing.  i've had one problem with this, but anyone can load the page and then 'print screen' and do it that way.  there is really not much of a way to stop somebody from printing.  sorry.
0
 

Expert Comment

by:Mimic34
ID: 1845412
there are some random escape lines that printers may think that is what they are and stop printing.  i've had one problem with this, but anyone can load the page and then 'print screen' and do it that way.  there is really not much of a way to stop somebody from printing.  sorry.
0
 

Author Comment

by:Beast101598
ID: 1845413
i wan prevent normal (not expert) user from printing.
someone have heard about 'media descriptors'?

this from [HTML 4.0 Specification]:
HTML allows authors to design documents that take advantage of the characteristics of the media where the document is to be rendered (e.g., graphical displays, television screens, handheld devices, speech-based browsers, braille-based tactile devices, etc.). By specifying the media attribute, authors allow user agents to load and apply style sheets selectively. Please consult the list of recognized media descriptors.

The following sample declarations apply to H1 elements. When projected in a business meeting, all instances will be blue. When printed, all instances will be centered.
<HEAD>
 <STYLE type="text/css" media="projection">
    H1 { color: blue}
 </STYLE>

 <STYLE type="text/css" media="print">
   H1 { text-align: center }
 </STYLE>
if i change in [...media="print"...] font-size=1, font changed also in browser. What wrong?

fanx

excuse me for english...

to Mimic34: some printers sends graphics information as see, so these esc simbols will be missed . or not?
0
 
LVL 5

Expert Comment

by:pbhj
ID: 7595095
Alistapart : http://www.alistapart.com/stories/goingtoprint has some info on creating print style sheets.  

Also, re your specific question (even though it looks like a second question which isn't allowed ...!) about why the font changed.  Possibly the browser decides that as you've not set a browser specific style sheet that it should use the next nearest option, your print one (- just guessing, could be a browser bug).  Anyway, try specifiying, eg

<LINK rel="stylesheet" type="text/css" href="mystyle.css">

first (in the header, this is a link to a seperate style sheet saved as plain text with extension .css) so the browser has a default to work with.

Also, on the subject of the original question could you put a line in your print style sheet like:

div {display: none !important}

Which would tell the printed version to not display any divs.  All content would need to be in a div.  Again this could be circumvented by many methods but looks hot-to-trot to me.

pbhj

PS: Let us know if that last bit works for you.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

830 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