Solved

can I forbit printing of my .html?

Posted on 1999-01-18
7
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

623 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