Solved

can I forbit printing of my .html?

Posted on 1999-01-18
7
171 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now