专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > PowerDesigner

用css回控制打印的pdf样式

发布时间:2011-06-20 20:21:17 文章来源:www.iduyao.cn 采编人员:星星草
用css来控制打印的pdf样式

@page { 

 size: A4 landscape;

 margin-left:10px;

 margin-right:10px; 

 margin-top:37px;

 margin-bottom:20px;

 @top-center { content: element(header) };

 @bottom-center { content: element(footer) } ;

}

 

.header {

 position: running(header);

 text-align:left;

}

.footer {

 position: running(footer);

 font-size: 90%;

 text-align:center;

}

.content{}

#pagenumber:before {

 content: counter(page); 

}

#pagecount:before {

 content: counter(pages);  

}

 

html里的写法:

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Component Associations Report</title>

<link href="css/pdf.css" rel="stylesheet" type="text/css" media="print" />

</head>

<body>

<div class="header" ><img src="img/argusLogo.GIF"/></div>

<div class="footer"> Page <span id="pagenumber"/></div>

 

 

</body>

</html>

 

拓展阅读:http://blog.csdn.net/shanliangliuxing/article/details/6833471

友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: