Solved

can I forbit printing of my .html?

Posted on 1999-01-18
7
177 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem with spacing columns on a row in a table 10 25
AdminLTE with wordpress 15 66
Create tabs to show divs 9 31
Hide Table in merge 3 10
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses four methods for overlaying images in a container on a web page
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

803 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