首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > PowerDesigner >

用css回控制打印的pdf样式

2012-06-27 
用css来控制打印的pdf样式@page {??size: A4 landscape?margin-left:10px?margin-right:10px??margin-t

用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 ><img src="img/argusLogo.GIF"/></div>

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

?

?

</body>

</html>

?

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

热点排行