Monday, October 12, 2009

Print Preview Hidden Image

Print_preview.php :

< html>
< head>
< link rel="stylesheet" type="text/css" media="all" href="watermark.css" />
< link rel="stylesheet" type="text/css" media="print" href="watermark-print.css" />
< !--[if lt IE 7]> < link rel="stylesheet" type="text/css" media="print" href="styles/watermark-print-ie.css" />
< /head>
< body>
< div class="watermark">< div>< img alt="Confidential" src="logo.gif" />< /div>< /div>

< b>Go to Print Preview Option< /b>

< /body>
< /html>


watermark.css :

/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}

body{
/* background:#ececec; */
margin:1em;padding:0;
}
div.watermark{
display:none;
}



watermark-print.css :

body{
margin:0;
}
div.watermark{
display:block;
position:fixed;
z-index:-1;
width:100%;
height:100%;
}
div.content > *:first-child,x:-moz-any-link{margin-top:0;}/* ff only */
div.watermark,x:-moz-any-link{z-index:auto;}/* ff only */
div.watermark,x:-moz-any-link,x:default{z-index:-1;}/* ff3 only */

@media all and (min-width: 0px){div.watermark{width:8.5in;}} /* opera only */

div.watermark div{
position:absolute;
left:0;
width:99%;
}

/* watermark position */
/* horizontal */
div.left{text-align:left;}
div.center{text-align:center;}
div.right{text-align:right;}
body:last-child:not(:root:root) div.right div{left:-160px;}/* safari only */

/* vertical */
div.top div{top:0;}
div.middle div{top:50%;margin-top:-80px;}
div.bottom div{bottom:2px;}

No comments:

Post a Comment